Skip to content

Conversation

@lyakh
Copy link
Collaborator

@lyakh lyakh commented Nov 19, 2018

A very early preview of what is currently in the works, the SOF counterpart to be pushed shortly

keyonjie and others added 30 commits September 20, 2018 12:24
For non-HDA mode, we don't handle the pp and init/stop chip related,
here correct it.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Unloading ASoC modules as used by the SOF driver leads to an object
being used after it's been freed. Fix this be clearing a reference to
it and making sure to check for its presence. This fixes issue thesofproject#144.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@intel.com>
Introduce effect type enumeration and vendor type to
differentiate between effects. We can use these types
to build multieffect pipelines in the topology and parse
those in the sof driver to send the correct ipc messages
to DSP firmware.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
Parse iir and fir eq from widget data field specifying
the effect type. Parse also optional initial eq params
sent in the eq control's private data.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
This change mirrors the changes in the previous patch
(commit id: 7128681) that separates out runtime resume and
system resume. During system suspend the hdac display power
needs to be turned off after powering down the hda controller
and DSP.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
The normal behaviour for PCI devices is that when the system suspend
occurs while the device is runtime suspended, its runtime_resume
method gets called to bring it back to full power. This seems to
cause race condition between runtime_resume and system suspend
and prevents the system from entering S2.

Also, it is recommended that bus controllers be suspended in the late
suspend phase and resumed in the resume early phase. This ensures that
the runtime pm for the devices is disabled before the suspend_late
is called. Therefore, switch to using suspend_late and resume_early
for the SOF PCI device.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Harshapriya N <harshapriya.n@intel.com>
Reset scontrol readback_offset after resuming from runtime pm
or system suspend as it is not valid anymore.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
This patch adds to bytes put a check to not exceed the topology
defined bytes control length. The tlv control header is used for
retrieving length instead to directly access the header words.

In bytes get the size field in the header is set the to the value
that is passed to the function minus the header length. It
prevents to write past the user space buffer. The size parameter
originates from topology. Checks for size violations vs. topology
and IPC are added.

The other changes add debug prints to kernel log to see the
actual size limits and do code cleanup.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Resetting the HDA controller during suspend seems to cause
a system suspend failure.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
This patch fixes commit (aa838fd) that causes kernel
errors while resuming from suspend.
hdac display power cannot be turned on before i915 is resumed.
So switch back to using resume instead of resume_early.
But we still need to power off the dsp and the
hdac display power in suspend_late.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Zhu Yingjiang <yingjiang.zhu@linux.intel.com>
This reverts commit 108d9cf.

Signed-off-by: Bard liao <bard.liao@intel.com>
This reverts commit 801d176.

Signed-off-by: Bard liao <bard.liao@intel.com>
sroute and connect are no longer used if we don't add it to the list.

Signed-off-by: Bard liao <bard.liao@intel.com>
A randconfig test managed to find a configuration, which breaks with
undefined PAGE_SIZE and PAGE_SHIFT. Include a header to guarantee,
that they are defined in all configurations.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@intel.com>
Use sof_ipc_panic_info to store panic info include filename and line
number.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
Panic info include filename and line number that panic called, dump this
info when panic happen. And output panic info when panic happen to help
debug.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
Machine driver may check some HW features which are probed
by SOF core driver. So platform device for machine driver
should be registered after SOF core is ready. And at this
time, dais of SOF have been registered to ASOC. It is better
to register card now.

Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
(1)Hda codec status and platform name are used by
   machine driver to create dai links, so it need
   to be set in sof core

(2)Try HDA codec if no I2S codec is found

Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
The default type of codec_mask in HDA system is unsigned long

Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
The upper 32bits of posbuf address was not set and lead to posbuf
not updated at capture, which lead to underrun when DPIB mode is
selected.

Here add configuring to it and fix the issue.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Early initialization of dma-traces enables output from the topology creation.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
The platform device is registered in new_mach_data function
on BYT. Now refine it to register devices at single point

Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
The hda_dsp_cl_load_fw() firmware loading method is a simple wrapper
around request_firmware(), it isn't HDA-specific and can be used by
other SOF hardware types. Rename it to snd_sof_load_firmware_raw()
and make it accessible to all.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
When loading firmware over SPI a special protocol has to be followed,
including a header, that has to be prepended to the firmware binary.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
sof_probe() has to check the type of the hardware when obtaining
machine operations.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
This patch removes a superfluous static function declaration and
simplifies a conditional statement.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
* Re-expose some dmi APIs for use in VCSM
smsc95xx is adjusting truesize when it shouldn't, and following a recent patch from Eric this is now triggering warnings.

This patch stops smsc95xx from changing truesize.

Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
Phil Elwell and others added 23 commits November 2, 2018 12:58
The size field in a Device Tree "reg" property is encoded in bytes, not
words.

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
Retain a vestigial cache_line_size parameter to improve backwards-
compatibility.

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
Rename the driver from "RPI simple soundcard" to "RPi-simple" so that
the driver name won't be mangled allowing to be used unaltered as the
card conf filename.
Signed-off-by: Serge Schneider <serge@raspberrypi.org>

PoE HAT driver cleanup

* Fix undeclared variable in rpi_poe_fan_suspend
* Add SPDX-License-Identifier
* Expand PoE acronym in Kconfig help
* Give clearer error message on of_property_count_u32_elems fail
* Add documentation
* Add vendor to of_device_id compatible string.
* Rename m_data_s struct to fw_data_s
* Fix typos

Fixes: thesofproject#2665

Signed-off-by: Serge Schneider <serge@raspberrypi.org>
Rationalise the offset and update all call sites.

Fixes raspberrypi/linux#2408
It appears the GPU only sends us a message all 10ms to update
the playback progress. Other than this, the playback position
(what SNDRV_PCM_IOCTL_DELAY will return) is not updated at all.
Userspace will see jitter up to 10ms in the audio position.

Make this a bit nicer for userspace by interpolating the
position using the CPU clock.

I'm not sure if setting snd_pcm_runtime.delay is the right
approach for this. Or if there is maybe an already existing
mechanism for position interpolation in the ALSA core.

I only set SNDRV_PCM_INFO_BATCH because this appears to remove
at least one situation snd_pcm_runtime.delay is used, so I have
to worry less in which place I have to update this field, or
how it interacts with the rest of ALSA.

In the future, it might be nice to use VC_AUDIO_MSG_TYPE_LATENCY.
One problem is that it requires sending a videocore message, and
waiting for a reply, which could make the implementation much
harder due to locking and synchronization requirements.
…project#2699)

During a bulk transfer we request a DMA allocation to hold the
scatter-gather list.  Most of the time, this allocation is small
(<< PAGE_SIZE), however it can be requested at a high enough frequency
to cause fragmentation and/or stress the CMA allocator (think time
spent in compaction here, or during allocations elsewhere).

Implement a pool to serve up small DMA allocations, falling back
to a coherent allocation if the request is greater than
VCHIQ_DMA_POOL_SIZE.

Signed-off-by: Oliver Gjoneski <ogjoneski@gmail.com>
The upstreamed driver for the GPIO expander has a different compatible
string. Change the relevant Device Tree files to match.

See: raspberrypi/linux#2704

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
Signed-off-by: Daniel Matuschek <daniel@hifiberry.com>
Signed-off-by: Phil Elwell <phil@raspberrypi.org>
Create a new composite driver to support PCM512x based Pi-HAT
DAC soundcards in order to reduce the maintenance overhead
for upstream changes.

This replaces the specific drivers for the following cards:
* Allo Piano DAC
* DionAudio Loco V2
* Justboom DAC
* IQAudioIO DAC
commit 2f7d8db upstream.

While having SECURITYFS enabled for the tpm subsystem is beneficial in
most cases, it is not strictly necessary to have it enabled at all.
Especially on platforms without any boot firmware integration of the TPM
(e.g. raspberry pi) it does not add any value for the tpm subsystem,
as there is no eventlog present.

By turning it from 'select' to 'imply' it still gets selected per
default, but enables users who want to save some kb of ram by turning
SECURITYFS off.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
This patch enables the support for SPI TPMs which follow the TCG TIS
FIFO/PTP specification like the SLB9670.
In order to decrease ram usage the weak dependency on CONFIG_SECURITFS
is explictly set to 'n'.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Device Tree overlay for the Infineon SLB9670 Trusted Platform Module add-on
boards, which can be used as a secure key storage and hwrng.
available as "Iridium SLB9670" by Infineon and "LetsTrust TPM" by
pi3g.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
The RPi PCM512x had the wrong compatible for the Allo Piano DAC which it
replaced. Change this to the correct value.
We've been getting checksum errors involving small UDP packets, usually
59B packets with 1 extra non-zero padding byte. netdev_rx_csum_fault()
has been complaining that HW is providing bad checksums. Turns out the
problem is in pskb_trim_rcsum_slow(), introduced in commit 88078d9
("net: pskb_trim_rcsum() and CHECKSUM_COMPLETE are friends").

The source of the problem is that when the bytes we are trimming start
at an odd address, as in the case of the 1 padding byte above,
skb_checksum() returns a byte-swapped value. We cannot just combine this
with skb->csum using csum_sub(). We need to use csum_block_sub() here
that takes into account the parity of the start address and handles the
swapping.

Matches existing code in __skb_postpull_rcsum() and esp_remove_trailer().

Fixes: 88078d9 ("net: pskb_trim_rcsum() and CHECKSUM_COMPLETE are friends")
Signed-off-by: Dimitris Michailidis <dmichail@google.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
The fixup for the VoiceHAT in 4.18 incorrectly tried to find the
sdmode GPIO pin under the card device, not the codec device.
This failed, and therefore caused the device probe to fail.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
Fix all whitespace, indentation, and bracing errors.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
Make voicehat_component_driver a const structure.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
Minor optimisation and allows to become checkpatch clean.
A msec value is read out of DT or from a define, and convert once to
jiffies, rather than every time that it is used.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
This is a very raw snapshot of the effort to enable SOF on SUE
Creek. It can send the SOF firmware over SPI to the board and
read out the first "FW READY" IPC message, although the latter
is performed in wrong endianness, which prevents it from
completing successfully.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
@lyakh lyakh requested review from lgirdwood and singalsu November 19, 2018 15:20
@lgirdwood
Copy link
Member

@lyakh can you rebase on top of target branch.

@plbossart
Copy link
Member

closing, no update or follow-up

@plbossart plbossart closed this Dec 21, 2018
plbossart pushed a commit that referenced this pull request Jun 7, 2021
While doing error injection testing I got the following panic

  kernel BUG at fs/btrfs/tree-log.c:1862!
  invalid opcode: 0000 [#1] SMP NOPTI
  CPU: 1 PID: 7836 Comm: mount Not tainted 5.13.0-rc1+ #305
  Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.13.0-2.fc32 04/01/2014
  RIP: 0010:link_to_fixup_dir+0xd5/0xe0
  RSP: 0018:ffffb5800180fa30 EFLAGS: 00010216
  RAX: fffffffffffffffb RBX: 00000000fffffffb RCX: ffff8f595287faf0
  RDX: ffffb5800180fa37 RSI: ffff8f5954978800 RDI: 0000000000000000
  RBP: ffff8f5953af9450 R08: 0000000000000019 R09: 0000000000000001
  R10: 000151f408682970 R11: 0000000120021001 R12: ffff8f5954978800
  R13: ffff8f595287faf0 R14: ffff8f5953c77dd0 R15: 0000000000000065
  FS:  00007fc5284c8c40(0000) GS:ffff8f59bbd00000(0000) knlGS:0000000000000000
  CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
  CR2: 00007fc5287f47c0 CR3: 000000011275e002 CR4: 0000000000370ee0
  Call Trace:
   replay_one_buffer+0x409/0x470
   ? btree_read_extent_buffer_pages+0xd0/0x110
   walk_up_log_tree+0x157/0x1e0
   walk_log_tree+0xa6/0x1d0
   btrfs_recover_log_trees+0x1da/0x360
   ? replay_one_extent+0x7b0/0x7b0
   open_ctree+0x1486/0x1720
   btrfs_mount_root.cold+0x12/0xea
   ? __kmalloc_track_caller+0x12f/0x240
   legacy_get_tree+0x24/0x40
   vfs_get_tree+0x22/0xb0
   vfs_kern_mount.part.0+0x71/0xb0
   btrfs_mount+0x10d/0x380
   ? vfs_parse_fs_string+0x4d/0x90
   legacy_get_tree+0x24/0x40
   vfs_get_tree+0x22/0xb0
   path_mount+0x433/0xa10
   __x64_sys_mount+0xe3/0x120
   do_syscall_64+0x3d/0x80
   entry_SYSCALL_64_after_hwframe+0x44/0xae

We can get -EIO or any number of legitimate errors from
btrfs_search_slot(), panicing here is not the appropriate response.  The
error path for this code handles errors properly, simply return the
error.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
bardliao pushed a commit to bardliao/linux that referenced this pull request Aug 4, 2025
If "try_verify_in_tasklet" is set for dm-verity, DM_BUFIO_CLIENT_NO_SLEEP
is enabled for dm-bufio. However, when bufio tries to evict buffers, there
is a chance to trigger scheduling in spin_lock_bh, the following warning
is hit:

BUG: sleeping function called from invalid context at drivers/md/dm-bufio.c:2745
in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 123, name: kworker/2:2
preempt_count: 201, expected: 0
RCU nest depth: 0, expected: 0
4 locks held by kworker/2:2/123:
 #0: ffff88800a2d1548 ((wq_completion)dm_bufio_cache){....}-{0:0}, at: process_one_work+0xe46/0x1970
 #1: ffffc90000d97d20 ((work_completion)(&dm_bufio_replacement_work)){....}-{0:0}, at: process_one_work+0x763/0x1970
 #2: ffffffff8555b528 (dm_bufio_clients_lock){....}-{3:3}, at: do_global_cleanup+0x1ce/0x710
 #3: ffff88801d5820b8 (&c->spinlock){....}-{2:2}, at: do_global_cleanup+0x2a5/0x710
Preemption disabled at:
[<0000000000000000>] 0x0
CPU: 2 UID: 0 PID: 123 Comm: kworker/2:2 Not tainted 6.16.0-rc3-g90548c634bd0 thesofproject#305 PREEMPT(voluntary)
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.3-0-ga6ed6b701f0a-prebuilt.qemu.org 04/01/2014
Workqueue: dm_bufio_cache do_global_cleanup
Call Trace:
 <TASK>
 dump_stack_lvl+0x53/0x70
 __might_resched+0x360/0x4e0
 do_global_cleanup+0x2f5/0x710
 process_one_work+0x7db/0x1970
 worker_thread+0x518/0xea0
 kthread+0x359/0x690
 ret_from_fork+0xf3/0x1b0
 ret_from_fork_asm+0x1a/0x30
 </TASK>

That can be reproduced by:

  veritysetup format --data-block-size=4096 --hash-block-size=4096 /dev/vda /dev/vdb
  SIZE=$(blockdev --getsz /dev/vda)
  dmsetup create myverity -r --table "0 $SIZE verity 1 /dev/vda /dev/vdb 4096 4096 <data_blocks> 1 sha256 <root_hash> <salt> 1 try_verify_in_tasklet"
  mount /dev/dm-0 /mnt -o ro
  echo 102400 > /sys/module/dm_bufio/parameters/max_cache_size_bytes
  [read files in /mnt]

Cc: stable@vger.kernel.org	# v6.4+
Fixes: 450e8de ("dm bufio: improve concurrent IO performance")
Signed-off-by: Wang Shuai <wangshuai12@xiaomi.com>
Signed-off-by: Sheng Yong <shengyong1@xiaomi.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.