/* * oxfw.h - a part of driver for OXFW970/971 based devices * * Copyright (c) Clemens Ladisch * Licensed under the terms of the GNU General Public License, version 2. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "../lib.h" #include "../fcp.h" #include "../packets-buffer.h" #include "../iso-resources.h" #include "../amdtp-am824.h" #include "../cmp.h" /* This is an arbitrary number for convinience. */ #define SND_OXFW_STREAM_FORMAT_ENTRIES 10 struct snd_oxfw { struct snd_card *card; struct fw_unit *unit; struct mutex mutex; spinlock_t lock; bool registered; struct delayed_work dwork; bool wrong_dbs; bool has_output; u8 *tx_stream_formats[SND_OXFW_STREAM_FORMAT_ENTRIES]; u8 *rx_stream_formats[SND_OXFW_STREAM_FORMAT_ENTRIES]; bool assumed; struct cmp_connection out_conn; struct cmp_connection in_conn; struct amdtp_stream tx_stream; struct amdtp_stream rx_stream; unsigned int capture_substreams; unsigned int playback_substreams; unsigned int midi_input_ports; unsigned int midi_output_ports; int dev_lock_count; bool dev_lock_changed; wait_queue_head_t hwdep_wait; const struct ieee1394_device_id *entry; void *spec; }; /* * AV/C Stream Format Information Specification 1.1 Working Draft * (Apr 2005, 1394TA) */ int avc_stream_set_format(struct fw_unit *unit, enum avc_general_plug_dir dir, unsigned int pid, u8 *format, unsigned int len); int avc_stream_get_format(struct fw_unit *unit, enum avc_general_plug_dir dir, unsigned int pid, u8 *buf, unsigned int *len, unsigned int eid); static inline int avc_stream_get_format_single(struct fw_unit *unit, enum avc_general_plug_dir dir, unsigned int pid, u8 *buf, unsigned int *len) { return avc_stream_get_format(unit, dir, pid, buf, len, 0xff); } static inline int avc_stream_get_format_list(struct fw_unit *unit, enum avc_general_plug_dir dir, unsigned int pid, u8 *buf, unsigned int *len, unsigned int eid) { return avc_stream_get_format(unit, dir, pid, buf, len, eid); } /* * AV/C Digital Interface Command Set General Specification 4.2 * (Sep 2004, 1394TA) */ int avc_general_inquiry_sig_fmt(struct fw_unit *unit, unsigned int rate, enum avc_general_plug_dir dir, unsigned short pid); int snd_oxfw_stream_init_simplex(struct snd_oxfw *oxfw, struct amdtp_stream *stream); int snd_oxfw_stream_start_simplex(struct snd_oxfw *oxfw, struct amdtp_stream *stream, unsigned int rate, unsigned int pcm_channels); void snd_oxfw_stream_stop_simplex(struct snd_oxfw *oxfw, struct amdtp_stream *stream); void snd_oxfw_stream_destroy_simplex(struct snd_oxfw *oxfw, struct amdtp_stream *stream); void snd_oxfw_stream_update_simplex(struct snd_oxfw *oxfw, struct amdtp_stream *stream); struct snd_oxfw_stream_formation { unsigned int rate; unsigned int pcm; unsigned int midi; }; int snd_oxfw_stream_parse_format(u8 *format, struct snd_oxfw_stream_formation *formation); int snd_oxfw_stream_get_current_formation(struct snd_oxfw *oxfw, enum avc_general_plug_dir dir, struct snd_oxfw_stream_formation *formation); int snd_oxfw_stream_discover(struct snd_oxfw *oxfw); void snd_oxfw_stream_lock_changed(struct snd_oxfw *oxfw); int snd_oxfw_stream_lock_try(struct snd_oxfw *oxfw); void snd_oxfw_stream_lock_release(struct snd_oxfw *oxfw); int snd_oxfw_create_pcm(struct snd_oxfw *oxfw); void snd_oxfw_proc_init(struct snd_oxfw *oxfw); int snd_oxfw_create_midi(struct snd_oxfw *oxfw); int snd_oxfw_create_hwdep(struct snd_oxfw *oxfw); int snd_oxfw_add_spkr(struct snd_oxfw *oxfw, bool is_lacie); int snd_oxfw_scs1x_add(struct snd_oxfw *oxfw); void snd_oxfw_scs1x_update(struct snd_oxfw *oxfw); /option>space:mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2017-02-01 17:45:02 +0000
committerIngo Molnar <mingo@kernel.org>2017-02-01 21:17:49 +0100
commitc8f325a59cfc718d13a50fbc746ed9b415c25e92 (patch)
treed53fbdac9d0781e39a13b2ac6b2bd258cf3b4140 /sound/aoa/soundbus/i2sbus
parentbf29bddf0417a4783da3b24e8c9e017ac649326f (diff)
efi/fdt: Avoid FDT manipulation after ExitBootServices()
Some AArch64 UEFI implementations disable the MMU in ExitBootServices(), after which unaligned accesses to RAM are no longer supported. Commit: abfb7b686a3e ("efi/libstub/arm*: Pass latest memory map to the kernel") fixed an issue in the memory map handling of the stub FDT code, but inadvertently created an issue with such firmware, by moving some of the FDT manipulation to after the invocation of ExitBootServices(). Given that the stub's libfdt implementation uses the ordinary, accelerated string functions, which rely on hardware handling of unaligned accesses, manipulating the FDT with the MMU off may result in alignment faults. So fix the situation by moving the update_fdt_memmap() call into the callback function invoked by efi_exit_boot_services() right before it calls the ExitBootServices() UEFI service (which is arguably a better place for it anyway) Note that disabling the MMU in ExitBootServices() is not compliant with the UEFI spec, and carries great risk due to the fact that switching from cached to uncached memory accesses halfway through compiler generated code (i.e., involving a stack) can never be done in a way that is architecturally safe. Fixes: abfb7b686a3e ("efi/libstub/arm*: Pass latest memory map to the kernel") Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Riku Voipio <riku.voipio@linaro.org> Cc: <stable@vger.kernel.org> Cc: mark.rutland@arm.com Cc: linux-efi@vger.kernel.org Cc: matt@codeblueprint.co.uk Cc: leif.lindholm@linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: http://lkml.kernel.org/r/1485971102-23330-2-git-send-email-ard.biesheuvel@linaro.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'sound/aoa/soundbus/i2sbus')