/* * i2sbus driver -- private definitions * * Copyright 2006 Johannes Berg * * GPL v2, can be found in COPYING. */ #ifndef __I2SBUS_H #define __I2SBUS_H #include #include #include #include #include #include #include #include #include "interface.h" #include "../soundbus.h" struct i2sbus_control { struct list_head list; struct macio_chip *macio; }; #define MAX_DBDMA_COMMANDS 32 struct dbdma_command_mem { dma_addr_t bus_addr; dma_addr_t bus_cmd_start; struct dbdma_cmd *cmds; void *space; int size; u32 running:1; u32 stopping:1; }; struct pcm_info { u32 created:1, /* has this direction been created with alsa? */ active:1; /* is this stream active? */ /* runtime information */ struct snd_pcm_substream *substream; int current_period; u32 frame_count; struct dbdma_command_mem dbdma_ring; volatile struct dbdma_regs __iomem *dbdma; struct completion *stop_completion; }; enum { aoa_resource_i2smmio = 0, aoa_resource_txdbdma, aoa_resource_rxdbdma, }; struct i2sbus_dev { struct soundbus_dev sound; struct macio_dev *macio; struct i2sbus_control *control; volatile struct i2s_interface_regs __iomem *intfregs; struct resource resources[3]; struct resource *allocated_resource[3]; int interrupts[3]; char rnames[3][32]; /* info about currently active substreams */ struct pcm_info out, in; snd_pcm_format_t format; unsigned int rate; /* list for a single controller */ struct list_head item; /* number of bus on controller */ int bus_number; /* for use by control layer */ struct pmf_function *enable, *cell_enable, *cell_disable, *clock_enable, *clock_disable; /* locks */ /* spinlock for low-level interrupt locking */ spinlock_t low_lock; /* mutex for high-level consistency */ struct mutex lock; }; #define soundbus_dev_to_i2sbus_dev(sdev) \ container_of(sdev, struct i2sbus_dev, sound) /* pcm specific functions */ extern int i2sbus_attach_codec(struct soundbus_dev *dev, struct snd_card *card, struct codec_info *ci, void *data); extern void i2sbus_detach_codec(struct soundbus_dev *dev, void *data); extern irqreturn_t i2sbus_tx_intr(int irq, void *devid); extern irqreturn_t i2sbus_rx_intr(int irq, void *devid); extern void i2sbus_wait_for_stop_both(struct i2sbus_dev *i2sdev); extern void i2sbus_pcm_prepare_both(struct i2sbus_dev *i2sdev); /* control specific functions */ extern int i2sbus_control_init(struct macio_dev* dev, struct i2sbus_control **c); extern void i2sbus_control_destroy(struct i2sbus_control *c); extern int i2sbus_control_add_dev(struct i2sbus_control *c, struct i2sbus_dev *i2sdev); extern void i2sbus_control_remove_dev(struct i2sbus_control *c, struct i2sbus_dev *i2sdev); extern int i2sbus_control_enable(struct i2sbus_control *c, struct i2sbus_dev *i2sdev); extern int i2sbus_control_cell(struct i2sbus_control *c, struct i2sbus_dev *i2sdev, int enable); extern int i2sbus_control_clock(struct i2sbus_control *c, struct i2sbus_dev *i2sdev, int enable); #endif /* __I2SBUS_H */ mp;id=e185934ff94466b4a449165e5f1c164a44d005f2'>sound/ak4117.h
diff options
context:
space:
mode:
authorNicolai Stange <nicstange@gmail.com>2016-12-07 22:21:33 +0100
committerTejun Heo <tj@kernel.org>2016-12-07 16:29:09 -0500
commite185934ff94466b4a449165e5f1c164a44d005f2 (patch)
treec773d05d4c72292e3babd4ce1a8bd56d965ebb4c /include/sound/ak4117.h
parent5c3ef39738f74a3759918cc1a1ad099504f9d1b7 (diff)
libata-scsi: disable SCT Write Same for the moment
SCT Write Same support had been introduced with commit 7b2030942859 ("libata: Add support for SCT Write Same") Some problems, namely excessive userspace segfaults, had been reported at http://lkml.kernel.org/r/20160908192736.GA4356@gmail.com This lead to commit 0ce1b18c42a5 ("libata: Some drives failing on SCT Write Same") which strived to disable SCT Write Same on !ZAC devices. Due to the way this was done and to the logic in sd_config_write_same(), this didn't work for those devices that have ->max_ws_blocks > SD_MAX_WS10_BLOCKS: for these, ->no_write_same and ->max_write_same_sectors would still be non-zero, but ->ws10 == ->ws16 == 0. This would cause sd_setup_write_same_cmnd() to demultiplex REQ_OP_WRITE_SAME requests to WRITE_SAME, and these in turn aren't supported by libata-scsi: EXT4-fs (dm-1): Delayed block allocation failed for inode 2625094 at logical offset 2032 with max blocks 2 with error 121 EXT4-fs (dm-1): This should not happen!! Data will be lost 121 == EREMOTEIO is what scsi_io_completion() asserts in case of invalid opcodes. Back to the original problem of userspace segfaults: this can be tracked down to ata_format_sct_write_same() overwriting the input page. Sometimes, this page is ZERO_PAGE(0) which ceases to be filled with zeros from that point on. Since ZERO_PAGE(0) is used for userspace .bss mappings, code of the following is doomed: static char *a = NULL; /* .bss */ ... if (a) *a = 'a'; This problem is not solved by disabling SCT Write Same for !ZAC devices only. It can certainly be fixed, but the final release is quite close -- so disable SCT Write Same for all ATA devices rather than introducing some SCT key buffer allocation schemes at this point. Fixes: 7b2030942859 ("libata: Add support for SCT Write Same") Signed-off-by: Nicolai Stange <nicstange@gmail.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'include/sound/ak4117.h')