Linux 3.10.97
Greg KH
maintainerI'm announcing the release of the 3.10.97 kernel.
All users of the 3.10 kernel series must upgrade.
The updated 3.10.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-3.10.y
and can be browsed at the normal kernel.org git web browser:
http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Makefile | 2 arch/parisc/include/uapi/asm/mman.h | 10 - arch/parisc/include/uapi/asm/siginfo.h | 4 arch/parisc/kernel/signal.c | 64 +++++- arch/sh/include/uapi/asm/unistd_64.h | 2 crypto/af_alg.c | 39 +++- crypto/algif_hash.c | 16 + crypto/crypto_user.c | 6 drivers/ata/ahci.c | 20 ++ drivers/ata/libahci.c | 13 + drivers/char/tpm/tpm_ibmvtpm.c | 2 drivers/hid/usbhid/hid-core.c | 4 drivers/md/dm-mpath.c | 7 drivers/md/persistent-data/dm-btree.c | 4 drivers/media/pci/saa7134/saa7134-alsa.c | 5 drivers/media/v4l2-core/v4l2-compat-ioctl32.c | 9 drivers/media/v4l2-core/videobuf2-dma-contig.c | 5 drivers/mtd/mtdpart.c | 4 drivers/net/wireless/ti/wlcore/io.h | 10 - drivers/net/wireless/ti/wlcore/spi.c | 10 - drivers/remoteproc/remoteproc_debugfs.c | 2 drivers/spi/spi-atmel.c | 3 drivers/spi/spi.c | 2 drivers/tty/tty_io.c | 24 ++ drivers/usb/host/xhci.c | 6 drivers/usb/serial/cp210x.c | 1 drivers/usb/serial/ftdi_sio.c | 1 drivers/usb/serial/ftdi_sio_ids.h | 1 drivers/usb/serial/option.c | 18 + drivers/usb/serial/ti_usb_3410_5052.c | 4 drivers/usb/serial/visor.c | 11 - fs/binfmt_elf.c | 10 - fs/ext4/ext4.h | 51 ++++- fs/ext4/resize.c | 4 fs/fscache/netfs.c | 9 fs/jbd2/transaction.c | 2 fs/ocfs2/dlm/dlmmaster.c | 26 +- fs/ocfs2/dlm/dlmrecovery.c | 2 fs/sysv/inode.c | 10 - include/crypto/if_alg.h | 8 include/linux/signal.h | 1 kernel/signal.c | 2 scripts/recordmcount.h | 2 sound/core/compress_offload.c | 11 + sound/core/oss/pcm_oss.c | 21 +- sound/core/rawmidi.c | 36 ++- sound/core/seq/oss/seq_oss_synth.c | 2 sound/core/seq/seq_clientmgr.c | 3 sound/core/seq/seq_ports.c | 233 +++++++++++++------------ sound/core/seq/seq_timer.c | 87 +++++++-- sound/core/seq/seq_virmidi.c | 6 sound/core/timer.c | 64 ++++-- sound/drivers/dummy.c | 35 +-- sound/pci/hda/patch_realtek.c | 1 sound/soc/soc-pcm.c | 3 sound/usb/midi.c | 1 sound/usb/quirks.c | 14 + 57 files changed, 652 insertions(+), 301 deletions(-)
Al Viro (1):
fix sysvfs symlinks
Alexandra Yates (1):
ahci: Intel DNV device IDs SATA
Andrey Konovalov (1):
ALSA: usb-audio: avoid freeing umidi object twice
Andrzej Hajda (1):
v4l2-compat-ioctl32: fix alignment for ARM64
Andy Leiserson (1):
fix calculation of meta_bg descriptor backups
Arnd Bergmann (1):
remoteproc: avoid stack overflow in debugfs file
Ben Hutchings (1):
USB: ti_usb_3410_502: Fix ID table size
Boris BREZILLON (1):
mtd: mtdpart: fix add_mtd_partitions error path
Daniele Palmas (1):
USB: serial: option: Adding support for Telit LE922
David Mosberger-Tang (1):
spi: atmel: Fix DMA-setup for transfers with more than 8 bits per word
David Turner (1):
ext4: Fix handling of extended tv_sec
Dmitry V. Levin (1):
sh64: fix __NR_fgetxattr
Greg Kroah-Hartman (3):
xhci: fix placement of call to usb_disabled()
USB: serial: ftdi_sio: add support for Yaesu SCU-18 cable Linux 3.10.97
Guillaume Fougnies (1):
ALSA: usb-audio: Fix TEAC UD-501/UD-503/NT-503 usb delay
Helge Deller (3):
parisc: Drop unused MADV_xxxK_PAGES flags from asm/mman.h
parisc: Fix syscall restarts
parisc: Fix __ARCH_SI_PREAMBLE_SIZE
Herbert Xu (3):
crypto: algif_hash - Only export and import on sockets with data
crypto: af_alg - Disallow bind/setkey/... after accept(2)
crypto: af_alg - Fix socket double-free when accept fails
Hon Ching \(Vicky\) Lo (1):
vTPM: fix memory allocation flag for rtce buffer at kernel boot
Ioan-Adrian Ratiu (1):
HID: usbhid: fix recursive deadlock
Jan Kara (1):
jbd2: Fix unreclaimed pages after truncate in data=journal mode
Johan Hovold (2):
spi: fix parent-device reference leak
USB: visor: fix null-deref at probe
John Ernberg (1):
USB: option: fix Cinterion AHxx enumeration
Kinglong Mee (1):
FS-Cache: Increase reference of parent after registering, netfs success
Maciej W. Rozycki (1):
binfmt_elf: Don't clobber passed executable's file header
Mathias Krause (1):
crypto: user - lock crypto_alg_list on alg dump
Mauricio Faria de Oliveira (1):
Revert "dm mpath: fix stalls when handling invalid ioctls"
Mauro Carvalho Chehab (1):
saa7134-alsa: Only frees registered sound cards
Mike Snitzer (1):
dm btree: fix leak of bufio-backed block in btree_split_sibling error path
Peter Dedecker (1):
USB: cp210x: add ID for IAI USB to RS485 adaptor
Peter Hurley (1):
tty: Fix unsafe ldisc reference via ioctl(TIOCGETD)
Richard Weinberger (1):
kernel/signal.c: unexport sigsuspend()
Takashi Iwai (16):
ALSA: compress: Disable GET_CODEC_CAPS ioctl for some architectures
ALSA: dummy: Disable switching timer backend via sysfs
ALSA: seq: Fix incorrect sanity check at snd_seq_oss_synth_cleanup()
ALSA: rawmidi: Remove kernel WARNING for NULL user-space buffer check
ALSA: rawmidi: Fix race at copying & updating the position
ALSA: pcm: Fix potential deadlock in OSS emulation
ALSA: seq: Fix yet another races among ALSA timer accesses
ALSA: seq: Fix race at closing in virmidi driver
ALSA: seq: Fix lockdep warnings due to double mutex locks
ALSA: timer: Code cleanup
ALSA: timer: Fix leftover link at closing
ALSA: timer: Fix link corruption due to double start or stop
ALSA: timer: Fix wrong instance passed to slave callbacks
ALSA: hda - Fix speaker output from VAIO AiO machines
ALSA: dummy: Implement timer backend switching more safely
ALSA: timer: Fix race between stop and interrupt
Tejun Heo (1):
libata: disable forced PORTS_IMPL for >= AHCI 1.3
Tiffany Lin (1):
media: vb2 dma-contig: Fully cache synchronise buffers in prepare and finish
Uri Mashiach (2):
wlcore/wl12xx: spi: fix oops on firmware load wlcore/wl12xx: spi: fix NULL pointer dereference (Oops)
Vinod Koul (1):
ASoC: dpcm: fix the BE state on hw_free
Vladis Dronov (1):
USB: serial: visor: fix crash on detecting device without write_urbs
Wang, Rui Y (1):
crypto: algif_hash - wait for crypto_ahash_init() to complete
Xiangliang Yu (1):
AHCI: Fix softreset failed issue of Port Multiplier
libin (1):
recordmcount: Fix endianness handling bug for nop_mcount
xuejiufei (2):
ocfs2/dlm: ignore cleaning the migration mle that is inuse ocfs2/dlm: clear refmap bit of recovery lock while doing local recovery cleanup
Greg KH
maintainerMakefile +1 -1
@@ -1,6 +1,6 @@ VERSION = 3 PATCHLEVEL = 10 -SUBLEVEL = 96 +SUBLEVEL = 97 EXTRAVERSION = NAME = TOSSUG Baby Fish
arch/parisc/include/uapi/asm/mman.h +0 -10
@@ -46,16 +46,6 @@#define MADV_DONTFORK 10/* don't inherit across fork */ #define MADV_DOFORK 11/* do inherit across fork */ -/* The range 12-64 is reserved for page size specification. */ -#define MADV_4K_PAGES 12/* Use 4K pages */ -#define MADV_16K_PAGES 14/* Use 16K pages */ -#define MADV_64K_PAGES 16/* Use 64K pages */ -#define MADV_256K_PAGES 18/* Use 256K pages */ -#define MADV_1M_PAGES 20/* Use 1 Megabyte pages */ -#define MADV_4M_PAGES 22/* Use 4 Megabyte pages */ -#define MADV_16M_PAGES 24/* Use 16 Megabyte pages */ -#define MADV_64M_PAGES 26/* Use 64 Megabyte pages */ -#define MADV_MERGEABLE 65/* KSM may merge identical pages */ #define MADV_UNMERGEABLE 66/* KSM may not merge identical pages */
arch/parisc/include/uapi/asm/siginfo.h +4 -0
@@ -1,6 +1,10 @@#ifndef _PARISC_SIGINFO_H#define _PARISC_SIGINFO_H +#if defined(__LP64__) +#define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int)) +#endif +#include <asm-generic/siginfo.h> #undef NSIGTRAP
arch/parisc/kernel/signal.c +52 -12
83 lines not on this page · raw message
arch/sh/include/uapi/asm/unistd_64.h +1 -1
@@ -278,7 +278,7 @@#define __NR_fsetxattr 256#define __NR_getxattr 257#define __NR_lgetxattr 258 -#define __NR_fgetxattr 269 +#define __NR_fgetxattr 259#define __NR_listxattr 260#define __NR_llistxattr 261#define __NR_flistxattr 262
crypto/af_alg.c +33 -6
@@ -125,6 +125,23 @@ int af_alg_release(struct socket *sock) }EXPORT_SYMBOL_GPL (af_alg_release); +void af_alg_release_parent (struct sock *sk) +{ +struct alg_sock *ask =alg_sk (sk); +bool last; + + sk = ask->parent; + ask =alg_sk (sk); + +lock_sock (sk); + last = !--ask->refcnt; +release_sock (sk); + +if (last) +sock_put (sk); +} +EXPORT_SYMBOL_GPL (af_alg_release_parent); +static int alg_bind (struct socket *sock,struct sockaddr *uaddr,int addr_len) {struct sock *sk = sock->sk;
@@ -132,6 +149,7 @@ static int alg_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)struct sockaddr_alg *sa = (void *)uaddr;const struct af_alg_type *type;void *private; +int err;if (sock->state ==SS_CONNECTED )return -EINVAL ;
@@ -157,16 +175,22 @@ static int alg_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)return PTR_ERR (private); } + err = -EBUSY ;lock_sock (sk); +if (ask->refcnt) + goto unlock;swap (ask->type, type);swap (ask->private, private); + err =0 ; + +unlock:release_sock (sk);alg_do_release (type, private); -return 0 ; +return err; } static int alg_setkey(struct sock *sk, char __user *ukey,
@@ -199,11 +223,15 @@ static int alg_setsockopt(struct socket *sock, int level, int optname,struct sock *sk = sock->sk;struct alg_sock *ask =alg_sk (sk);const struct af_alg_type *type; -int err = -ENOPROTOOPT ; +int err = -EBUSY ;lock_sock (sk); +if (ask->refcnt) + goto unlock; + type = ask->type; + err = -ENOPROTOOPT ;if (level !=SOL_ALG || !type) goto unlock;
@@ -247,14 +275,13 @@ int af_alg_accept(struct sock *sk, struct socket *newsock)security_sk_clone (sk, sk2); err = type->accept (ask->private, sk2); -if (err) { -sk_free (sk2); +if (err) goto unlock; - } sk2->sk_family =PF_ALG ; -sock_hold (sk); +if (!ask->refcnt++) +sock_hold (sk);alg_sk (sk2)->parent = sk;alg_sk (sk2)->type = type;
crypto/algif_hash.c +13 -3
@@ -51,7 +51,8 @@ static int hash_sendmsg(struct kiocb *unused, struct socket *sock,lock_sock (sk);if (!ctx->more) { - err =crypto_ahash_init (&ctx->req); + err =af_alg_wait_for_completion (crypto_ahash_init (&ctx->req), + &ctx->completion);if (err) goto unlock; }
@@ -131,6 +132,7 @@ static ssize_t hash_sendpage(struct socket *sock, struct page *page, }else {if (!ctx->more) { err =crypto_ahash_init (&ctx->req); + err =af_alg_wait_for_completion (err, &ctx->completion);if (err) goto unlock; }
@@ -192,9 +194,14 @@ static int hash_accept(struct socket *sock, struct socket *newsock, int flags)struct sock *sk2;struct alg_sock *ask2;struct hash_ctx *ctx2; +bool more;int err; - err =crypto_ahash_export (req, state); +lock_sock (sk); + more = ctx->more; + err = more ?crypto_ahash_export (req, state) :0 ; +release_sock (sk); +if (err)return err;
@@ -205,7 +212,10 @@ static int hash_accept(struct socket *sock, struct socket *newsock, int flags) sk2 = newsock->sk; ask2 =alg_sk (sk2); ctx2 = ask2->private; - ctx2->more =1 ; + ctx2->more = more; + +if (!more) +return err; err =crypto_ahash_import (&ctx2->req, state);if (err) {
crypto/crypto_user.c +5 -1
@@ -477,6 +477,7 @@ static int crypto_user_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)if (link->dump ==NULL )return -EINVAL ; +down_read (&crypto_alg_sem);list_for_each_entry (alg, &crypto_alg_list, cra_list) dump_alloc +=CRYPTO_REPORT_MAXSIZE ;
@@ -486,8 +487,11 @@ static int crypto_user_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh) .done = link->done, .min_dump_alloc = dump_alloc, }; -return netlink_dump_start (crypto_nlsk, skb, nlh, &c); + err =netlink_dump_start (crypto_nlsk, skb, nlh, &c); } +up_read (&crypto_alg_sem); + +return err; } err = nlmsg_parse(nlh, crypto_msg_min[type], attrs, CRYPTOCFGA_MAX,
drivers/ata/ahci.c +20 -0
@@ -247,6 +247,26 @@ static const struct pci_device_id ahci_pci_tbl[] = { { PCI_VDEVICE(INTEL, 0x3b2b), board_ahci }, /* PCH RAID */ { PCI_VDEVICE(INTEL, 0x3b2c), board_ahci }, /* PCH RAID */ { PCI_VDEVICE(INTEL, 0x3b2f), board_ahci }, /* PCH AHCI */ + { PCI_VDEVICE(INTEL, 0x19b0), board_ahci }, /* DNV AHCI */ + { PCI_VDEVICE(INTEL, 0x19b1), board_ahci }, /* DNV AHCI */ + { PCI_VDEVICE(INTEL, 0x19b2), board_ahci }, /* DNV AHCI */ + { PCI_VDEVICE(INTEL, 0x19b3), board_ahci }, /* DNV AHCI */ + { PCI_VDEVICE(INTEL, 0x19b4), board_ahci }, /* DNV AHCI */ + { PCI_VDEVICE(INTEL, 0x19b5), board_ahci }, /* DNV AHCI */ + { PCI_VDEVICE(INTEL, 0x19b6), board_ahci }, /* DNV AHCI */ + { PCI_VDEVICE(INTEL, 0x19b7), board_ahci }, /* DNV AHCI */ + { PCI_VDEVICE(INTEL, 0x19bE), board_ahci }, /* DNV AHCI */ + { PCI_VDEVICE(INTEL, 0x19bF), board_ahci }, /* DNV AHCI */ + { PCI_VDEVICE(INTEL, 0x19c0), board_ahci }, /* DNV AHCI */ + { PCI_VDEVICE(INTEL, 0x19c1), board_ahci }, /* DNV AHCI */ + { PCI_VDEVICE(INTEL, 0x19c2), board_ahci }, /* DNV AHCI */ + { PCI_VDEVICE(INTEL, 0x19c3), board_ahci }, /* DNV AHCI */ + { PCI_VDEVICE(INTEL, 0x19c4), board_ahci }, /* DNV AHCI */ + { PCI_VDEVICE(INTEL, 0x19c5), board_ahci }, /* DNV AHCI */ + { PCI_VDEVICE(INTEL, 0x19c6), board_ahci }, /* DNV AHCI */ + { PCI_VDEVICE(INTEL, 0x19c7), board_ahci }, /* DNV AHCI */ + { PCI_VDEVICE(INTEL, 0x19cE), board_ahci }, /* DNV AHCI */ + { PCI_VDEVICE(INTEL, 0x19cF), board_ahci }, /* DNV AHCI */ { PCI_VDEVICE(INTEL, 0x1c02), board_ahci }, /* CPT AHCI */ { PCI_VDEVICE(INTEL, 0x1c03), board_ahci }, /* CPT AHCI */ { PCI_VDEVICE(INTEL, 0x1c04), board_ahci }, /* CPT RAID */
drivers/ata/libahci.c +11 -2
@@ -486,8 +486,8 @@ void ahci_save_initial_config(struct device *dev, } } -/* fabricate port_map from cap.nr_ports */ -if (!port_map) { +/* fabricate port_map from cap.nr_ports for < AHCI 1.3 */ +if (!port_map && vers <0x10300 ) { port_map = (1 <<ahci_nr_ports (cap)) -1 ;dev_warn (dev,"forcing PORTS_IMPL to 0x%x\n" , port_map);
@@ -1244,6 +1244,15 @@ static int ahci_exec_polled_cmd(struct ata_port *ap, int pmp,ata_tf_to_fis (tf, pmp, is_cmd, fis);ahci_fill_cmd_slot (pp,0 , cmd_fis_len | flags | (pmp <<12 )); +/* set port value for softreset of Port Multiplier */ +if (pp->fbs_enabled && pp->fbs_last_dev != pmp) { + tmp =readl (port_mmio +PORT_FBS ); + tmp &= ~(PORT_FBS_DEV_MASK |PORT_FBS_DEC ); + tmp |= pmp <<PORT_FBS_DEV_OFFSET ; +writel (tmp, port_mmio +PORT_FBS ); + pp->fbs_last_dev = pmp; + } +/* issue & wait */ writel (1 , port_mmio +PORT_CMD_ISSUE );
drivers/char/tpm/tpm_ibmvtpm.c +1 -1
@@ -529,7 +529,7 @@ static void ibmvtpm_crq_process(struct ibmvtpm_crq *crq, } ibmvtpm->rtce_size =be16_to_cpu (crq->len); ibmvtpm->rtce_buf =kmalloc (ibmvtpm->rtce_size, -GFP_KERNEL ); +GFP_ATOMIC );if (!ibmvtpm->rtce_buf) {dev_err (ibmvtpm->dev,"Failed to allocate memory for rtce buffer\n" );return ;
drivers/hid/usbhid/hid-core.c +2 -2
@@ -490,8 +490,6 @@ static void hid_ctrl(struct urb *urb)struct usbhid_device *usbhid = hid->driver_data;int unplug =0 , status = urb->status; -spin_lock (&usbhid->lock); -switch (status) {case 0 :/* success */ if (usbhid->ctrl[usbhid->ctrltail].dir ==USB_DIR_IN )
@@ -511,6 +509,8 @@ static void hid_ctrl(struct urb *urb)hid_warn (urb->dev,"ctrl urb status %d received\n" , status); } +spin_lock (&usbhid->lock); +if (unplug) { usbhid->ctrltail = usbhid->ctrlhead; }else {
drivers/md/dm-mpath.c +2 -5
@@ -1608,11 +1608,8 @@ static int multipath_ioctl(struct dm_target *ti, unsigned int cmd,/* * Only pass ioctls through if the device sizes match exactly. */ -if (!bdev || ti->len !=i_size_read (bdev->bd_inode) >>SECTOR_SHIFT ) { -int err =scsi_verify_blk_ioctl (NULL , cmd); -if (err) - r = err; - } +if (!r && ti->len !=i_size_read (bdev->bd_inode) >>SECTOR_SHIFT ) + r =scsi_verify_blk_ioctl (NULL , cmd);if (r == -ENOTCONN && !fatal_signal_pending (current))queue_work (kmultipathd, &m->process_queued_ios);
drivers/md/persistent-data/dm-btree.c +3 -1
@@ -455,8 +455,10 @@ static int btree_split_sibling(struct shadow_spine *s, dm_block_t root, r =insert_at (sizeof (__le64), pn, parent_index +1 ,le64_to_cpu (rn->keys[0 ]), &location); -if (r) +if (r) { +unlock_block (s->info, right);return r; + }if (key <le64_to_cpu (rn->keys[0 ])) {unlock_block (s->info, right);
drivers/media/pci/saa7134/saa7134-alsa.c +4 -1
@@ -1145,6 +1145,8 @@ static int alsa_device_init(struct saa7134_dev *dev)static int alsa_device_exit (struct saa7134_dev *dev) { +if (!snd_saa7134_cards[dev->nr]) +return 1 ;snd_card_free (snd_saa7134_cards[dev->nr]); snd_saa7134_cards[dev->nr] =NULL ;
@@ -1194,7 +1196,8 @@ static void saa7134_alsa_exit(void)int idx;for (idx =0 ; idx <SNDRV_CARDS ; idx++) { -snd_card_free (snd_saa7134_cards[idx]); +if (snd_saa7134_cards[idx]) +snd_card_free (snd_saa7134_cards[idx]); } saa7134_dmasound_init =NULL ;
drivers/media/v4l2-core/v4l2-compat-ioctl32.c +5 -4
@@ -264,7 +264,7 @@ static int put_v4l2_create32(struct v4l2_create_buffers *kp, struct v4l2_create_struct v4l2_standard32 {__u32 index; -__u32 id[2 ];/* __u64 would get the alignment wrong */ +compat_u64 id;__u8 name[24 ];struct v4l2_fract frameperiod;/* Frames, not fields */ __u32 framelines;
@@ -284,7 +284,7 @@ static int put_v4l2_standard32(struct v4l2_standard *kp, struct v4l2_standard32 { if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_standard32)) || put_user(kp->index, &up->index) || - copy_to_user(up->id, &kp->id, sizeof(__u64)) || + put_user(kp->id, &up->id) || copy_to_user(up->name, kp->name, 24) || copy_to_user(&up->frameperiod, &kp->frameperiod, sizeof(kp->frameperiod)) || put_user(kp->framelines, &up->framelines) ||
@@ -576,10 +576,10 @@ struct v4l2_input32 {__u32 type;/* Type of input */ __u32 audioset;/* Associated audios (bitfield) */ __u32 tuner;/* Associated tuner */ -v4l2_std_id std; +compat_u64 std;__u32 status;__u32 reserved[4 ]; -} __attribute__ ((packed)); +};/* The 64-bit v4l2_input struct has extra padding at the end of the struct. Otherwise it is identical to the 32-bit version. */
@@ -719,6 +719,7 @@ static int put_v4l2_ext_controls32(struct v4l2_ext_controls *kp, struct v4l2_extstruct v4l2_event32 {__u32 type;union { +compat_s64 value64;__u8 data[64 ]; } u;__u32 pending;
drivers/media/v4l2-core/videobuf2-dma-contig.c +3 -2
@@ -117,7 +117,8 @@ static void vb2_dc_prepare(void *buf_priv)if (!sgt || buf->db_attach)return ; -dma_sync_sg_for_device (buf->dev, sgt->sgl, sgt->nents, buf->dma_dir); +dma_sync_sg_for_device (buf->dev, sgt->sgl, sgt->orig_nents, + buf->dma_dir); }static void vb2_dc_finish (void *buf_priv)
@@ -129,7 +130,7 @@ static void vb2_dc_finish(void *buf_priv)if (!sgt || buf->db_attach)return ; -dma_sync_sg_for_cpu (buf->dev, sgt->sgl, sgt->nents, buf->dma_dir); +dma_sync_sg_for_cpu (buf->dev, sgt->sgl, sgt->orig_nents, buf->dma_dir); }/*********************************************/
drivers/mtd/mtdpart.c +3 -1
@@ -634,8 +634,10 @@ int add_mtd_partitions(struct mtd_info *master,for (i =0 ; i < nbparts; i++) { slave =allocate_partition (master, parts + i, i, cur_offset); -if (IS_ERR (slave)) +if (IS_ERR (slave)) { +del_mtd_partitions (master);return PTR_ERR (slave); + }mutex_lock (&mtd_partitions_mutex);list_add (&slave->list, &mtd_partitions);
drivers/net/wireless/ti/wlcore/io.h +7 -3
@@ -203,19 +203,23 @@ static inline int __must_check wlcore_write_reg(struct wl1271 *wl, int reg,static inline void wl1271_power_off (struct wl1271 *wl) { -int ret; +int ret =0 ;if (!test_bit (WL1271_FLAG_GPIO_POWER , &wl->flags))return ; - ret = wl->if_ops->power (wl->dev, false); +if (wl->if_ops->power) + ret = wl->if_ops->power (wl->dev, false);if (!ret)clear_bit (WL1271_FLAG_GPIO_POWER , &wl->flags); }static inline int wl1271_power_on (struct wl1271 *wl) { -int ret = wl->if_ops->power (wl->dev, true); +int ret =0 ; + +if (wl->if_ops->power) + ret = wl->if_ops->power (wl->dev, true);if (ret ==0 )set_bit (WL1271_FLAG_GPIO_POWER , &wl->flags);
drivers/net/wireless/ti/wlcore/spi.c +7 -3
@@ -72,7 +72,10 @@*/ #define SPI_AGGR_BUFFER_SIZE (4 * PAGE_SIZE) -#define WSPI_MAX_NUM_OF_CHUNKS (SPI_AGGR_BUFFER_SIZE / WSPI_MAX_CHUNK_SIZE) +/* Maximum number of SPI write chunks */ +#define WSPI_MAX_NUM_OF_CHUNKS \ + ((SPI_AGGR_BUFFER_SIZE / WSPI_MAX_CHUNK_SIZE) + 1) +struct wl12xx_spi_glue {struct device *dev;
@@ -270,9 +273,10 @@ static int __must_check wl12xx_spi_raw_write(struct device *child, int addr, void *buf, size_t len, bool fixed) {struct wl12xx_spi_glue *glue =dev_get_drvdata (child->parent); -struct spi_transfer t[2 * (WSPI_MAX_NUM_OF_CHUNKS +1 )]; +/* SPI write buffers - 2 for each chunk */ +struct spi_transfer t[2 *WSPI_MAX_NUM_OF_CHUNKS ];struct spi_message m; -u32 commands[WSPI_MAX_NUM_OF_CHUNKS ]; +u32 commands[WSPI_MAX_NUM_OF_CHUNKS ];/* 1 command per chunk */ u32 *cmd;u32 chunk_len;int i;
drivers/remoteproc/remoteproc_debugfs.c +1 -1
@@ -156,7 +156,7 @@ rproc_recovery_write(struct file *filp, const char __user *user_buf,char buf[10 ];int ret; -if (count >sizeof (buf)) +if (count <1 || count >sizeof (buf))return count; ret =copy_from_user (buf, user_buf, count);
drivers/spi/spi-atmel.c +2 -1
@@ -594,7 +594,8 @@ static int atmel_spi_next_xfer_dma_submit(struct spi_master *master, *plen = len; -if (atmel_spi_dma_slave_config (as, &slave_config,8 )) +if (atmel_spi_dma_slave_config (as, &slave_config, + xfer->bits_per_word)) goto err_exit;/* Send both scatterlists */
drivers/spi/spi.c +1 -1
@@ -1047,7 +1047,7 @@ struct spi_master *spi_alloc_master(struct device *dev, unsigned size) master->bus_num =-1 ; master->num_chipselect =1 ; master->dev.class = &spi_master_class; - master->dev.parent =get_device (dev); + master->dev.parent = dev;spi_master_set_devdata (master, &master[1 ]);return master;
drivers/tty/tty_io.c +23 -1
@@ -2576,6 +2576,28 @@ static int tiocsetd(struct tty_struct *tty, int __user *p) }/** +* tiocgetd - get line discipline +* @tty: tty device +* @p: pointer to user data +* +* Retrieves the line discipline id directly from the ldisc. +* +* Locking: waits for ldisc reference (in case the line discipline +* is changing or the tty is being hungup) +*/ + +static int tiocgetd (struct tty_struct *tty,int __user *p) +{ +struct tty_ldisc *ld; +int ret; + + ld =tty_ldisc_ref_wait (tty); + ret =put_user (ld->ops->num, p); +tty_ldisc_deref (ld); +return ret; +} + +/** * send_break - performed time break * @tty: device to break on * @duration: timeout in mS
@@ -2789,7 +2811,7 @@ long tty_ioctl(struct file *file, unsigned int cmd, unsigned long arg)case TIOCGSID :return tiocgsid (tty, real_tty, p);case TIOCGETD : -return put_user (tty->ldisc->ops->num, (int __user *)p); +return tiocgetd (tty, p);case TIOCSETD :return tiocsetd (tty, p);case TIOCVHANGUP :
drivers/usb/host/xhci.c +3 -3
@@ -4788,6 +4788,9 @@ static int __init xhci_hcd_init(void) {int retval; +if (usb_disabled ()) +return -ENODEV ; + retval =xhci_register_pci ();if (retval <0 ) {printk (KERN_DEBUG "Problem registering PCI driver." );
@@ -4816,9 +4819,6 @@ static int __init xhci_hcd_init(void)/* xhci_run_regs has eight fields and embeds 128 xhci_intr_regs */ BUILD_BUG_ON (sizeof (struct xhci_run_regs ) != (8 +8 *128 )*32 /8 ); -if (usb_disabled ()) -return -ENODEV ; -return 0 ; unreg_pci:xhci_unregister_pci ();
drivers/usb/serial/cp210x.c +1 -0
@@ -98,6 +98,7 @@ static const struct usb_device_id id_table[] = { { USB_DEVICE(0x10C4, 0x81AC) }, /* MSD Dash Hawk */ { USB_DEVICE(0x10C4, 0x81AD) }, /* INSYS USB Modem */ { USB_DEVICE(0x10C4, 0x81C8) }, /* Lipowsky Industrie Elektronik GmbH, Baby-JTAG */ + { USB_DEVICE(0x10C4, 0x81D7) }, /* IAI Corp. RCB-CV-USB USB to RS485 Adaptor */ { USB_DEVICE(0x10C4, 0x81E2) }, /* Lipowsky Industrie Elektronik GmbH, Baby-LIN */ { USB_DEVICE(0x10C4, 0x81E7) }, /* Aerocomm Radio */ { USB_DEVICE(0x10C4, 0x81E8) }, /* Zephyr Bioharness */
drivers/usb/serial/ftdi_sio.c +1 -0
@@ -840,6 +840,7 @@ static struct usb_device_id id_table_combined [] = { { USB_DEVICE(FTDI_VID, FTDI_TURTELIZER_PID), .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, { USB_DEVICE(RATOC_VENDOR_ID, RATOC_PRODUCT_ID_USB60F) }, + { USB_DEVICE(RATOC_VENDOR_ID, RATOC_PRODUCT_ID_SCU18) }, { USB_DEVICE(FTDI_VID, FTDI_REU_TINY_PID) },/* Papouch devices based on FTDI chip */
drivers/usb/serial/ftdi_sio_ids.h +1 -0
@@ -615,6 +615,7 @@*/ #define RATOC_VENDOR_ID 0x0584#define RATOC_PRODUCT_ID_USB60F 0xb020 +#define RATOC_PRODUCT_ID_SCU18 0xb03a/* * Infineon Technologies
drivers/usb/serial/option.c +17 -1
@@ -269,6 +269,8 @@ static void option_instat_callback(struct urb *urb);#define TELIT_PRODUCT_CC864_SINGLE 0x1006#define TELIT_PRODUCT_DE910_DUAL 0x1010#define TELIT_PRODUCT_UE910_V2 0x1012 +#define TELIT_PRODUCT_LE922_USBCFG0 0x1042 +#define TELIT_PRODUCT_LE922_USBCFG3 0x1043#define TELIT_PRODUCT_LE920 0x1200#define TELIT_PRODUCT_LE910 0x1201
@@ -623,6 +625,16 @@ static const struct option_blacklist_info telit_le920_blacklist = { .reserved = BIT(1) | BIT(5), }; +static const struct option_blacklist_info telit_le922_blacklist_usbcfg0 = { + .sendsetup =BIT (2 ), + .reserved =BIT (0 ) |BIT (1 ) |BIT (3 ), +}; + +static const struct option_blacklist_info telit_le922_blacklist_usbcfg3 = { + .sendsetup =BIT (0 ), + .reserved =BIT (1 ) |BIT (2 ) |BIT (3 ), +}; +static const struct usb_device_id option_ids[] = { {USB_DEVICE (OPTION_VENDOR_ID ,OPTION_PRODUCT_COLT ) }, {USB_DEVICE (OPTION_VENDOR_ID ,OPTION_PRODUCT_RICOLA ) },
@@ -1168,6 +1180,10 @@ static const struct usb_device_id option_ids[] = { { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_CC864_SINGLE) }, { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_DE910_DUAL) }, { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_UE910_V2) }, + { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE922_USBCFG0), + .driver_info = (kernel_ulong_t)&telit_le922_blacklist_usbcfg0 }, + { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE922_USBCFG3), + .driver_info = (kernel_ulong_t)&telit_le922_blacklist_usbcfg3 }, { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE910), .driver_info = (kernel_ulong_t)&telit_le910_blacklist }, { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE920),
@@ -1679,7 +1695,7 @@ static const struct usb_device_id option_ids[] = { { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_EU3_P) }, { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_PH8), .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, - { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_AHXX) }, + { USB_DEVICE_INTERFACE_CLASS(CINTERION_VENDOR_ID, CINTERION_PRODUCT_AHXX, 0xff) }, { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_PLXX), .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_HC28_MDM) },
drivers/usb/serial/ti_usb_3410_5052.c +2 -2
@@ -158,7 +158,7 @@ static unsigned int product_5052_count;/* the array dimension is the number of default entries plus */ /* TI_EXTRA_VID_PID_COUNT user defined entries plus 1 terminating */ /* null entry */ -static struct usb_device_id ti_id_table_3410[15 +TI_EXTRA_VID_PID_COUNT +1 ] = { +static struct usb_device_id ti_id_table_3410[16 +TI_EXTRA_VID_PID_COUNT +1 ] = { {USB_DEVICE (TI_VENDOR_ID ,TI_3410_PRODUCT_ID ) }, {USB_DEVICE (TI_VENDOR_ID ,TI_3410_EZ430_ID ) }, {USB_DEVICE (MTS_VENDOR_ID ,MTS_GSM_NO_FW_PRODUCT_ID ) },
@@ -184,7 +184,7 @@ static struct usb_device_id ti_id_table_5052[5+TI_EXTRA_VID_PID_COUNT+1] = { { USB_DEVICE(TI_VENDOR_ID, TI_5052_FIRMWARE_PRODUCT_ID) }, }; -static struct usb_device_id ti_id_table_combined[19 +2 *TI_EXTRA_VID_PID_COUNT +1 ] = { +static struct usb_device_id ti_id_table_combined[20 +2 *TI_EXTRA_VID_PID_COUNT +1 ] = { {USB_DEVICE (TI_VENDOR_ID ,TI_3410_PRODUCT_ID ) }, {USB_DEVICE (TI_VENDOR_ID ,TI_3410_EZ430_ID ) }, { USB_DEVICE(MTS_VENDOR_ID, MTS_GSM_NO_FW_PRODUCT_ID) },
drivers/usb/serial/visor.c +9 -2
@@ -551,6 +551,11 @@ static int treo_attach(struct usb_serial *serial) (serial->num_interrupt_in == 0))return 0 ; +if (serial->num_bulk_in <2 || serial->num_interrupt_in <2 ) { +dev_err (&serial->interface->dev,"missing endpoints\n" ); +return -ENODEV ; + } +/* * It appears that Treos and Kyoceras want to use the * 1st bulk in endpoint to communicate with the 2nd bulk out endpoint,
@@ -604,8 +609,10 @@ static int clie_5_attach(struct usb_serial *serial)*/ /* some sanity check */ -if (serial->num_ports <2 ) -return -1 ; +if (serial->num_bulk_out <2 ) { +dev_err (&serial->interface->dev,"missing bulk out endpoints\n" ); +return -ENODEV ; + }/* port 0 now uses the modified endpoint Address */ port = serial->port[0 ];
fs/binfmt_elf.c +5 -5
@@ -682,16 +682,16 @@ static int load_elf_binary(struct linux_binprm *bprm)*/ would_dump (bprm, interpreter); - retval =kernel_read (interpreter,0 , bprm->buf, -BINPRM_BUF_SIZE ); -if (retval !=BINPRM_BUF_SIZE ) { +/* Get the exec headers */ + retval =kernel_read (interpreter,0 , + (void *)&loc->interp_elf_ex, +sizeof (loc->interp_elf_ex)); +if (retval !=sizeof (loc->interp_elf_ex)) {if (retval >=0 ) retval = -EIO ; goto out_free_dentry; } -/* Get the exec headers */ - loc->interp_elf_ex = *((struct elfhdr *)bprm->buf);break ; } elf_ppnt++;
fs/ext4/ext4.h +44 -7
69 lines not on this page · raw message
fs/ext4/resize.c +2 -2
@@ -1025,7 +1025,7 @@ exit_free:* do not copy the full number of backups at this time. The resize * which changed s_groups_count will backup again. */ -static void update_backups (struct super_block *sb,int blk_off,char *data, +static void update_backups (struct super_block *sb,sector_t blk_off,char *data,int size,int meta_bg) {struct ext4_sb_info *sbi =EXT4_SB (sb);
@@ -1050,7 +1050,7 @@ static void update_backups(struct super_block *sb, int blk_off, char *data, group =ext4_list_backups (sb, &three, &five, &seven); last = sbi->s_groups_count; }else { - group =ext4_meta_bg_first_group (sb, group) +1 ; + group =ext4_get_group_number (sb, blk_off) +1 ; last = (ext4_group_t)(group +EXT4_DESC_PER_BLOCK (sb) -2 ); }
fs/fscache/netfs.c +4 -5
@@ -45,9 +45,6 @@ int __fscache_register_netfs(struct fscache_netfs *netfs) netfs->primary_index->parent = &fscache_fsdef_index; netfs->primary_index->netfs_data = netfs; -atomic_inc (&netfs->primary_index->parent->usage); -atomic_inc (&netfs->primary_index->parent->n_children); -spin_lock_init (&netfs->primary_index->lock);INIT_HLIST_HEAD (&netfs->primary_index->backing_objects);
@@ -60,6 +57,9 @@ int __fscache_register_netfs(struct fscache_netfs *netfs) goto already_registered; } +atomic_inc (&netfs->primary_index->parent->usage); +atomic_inc (&netfs->primary_index->parent->n_children); +list_add (&netfs->link, &fscache_netfs_list); ret =0 ;
@@ -70,8 +70,7 @@ already_registered:up_write (&fscache_addremove_sem);if (ret <0 ) { - netfs->primary_index->parent =NULL ; -__fscache_cookie_put (netfs->primary_index); +kmem_cache_free (fscache_cookie_jar, netfs->primary_index); netfs->primary_index =NULL ; }
fs/jbd2/transaction.c +2 -0
@@ -1936,6 +1936,7 @@ static int journal_unmap_buffer(journal_t *journal, struct buffer_head *bh,if (!buffer_dirty (bh)) {/* bdflush has written it. We can drop it now */ +__jbd2_journal_remove_checkpoint (jh); goto zap_buffer; }
@@ -1965,6 +1966,7 @@ static int journal_unmap_buffer(journal_t *journal, struct buffer_head *bh,/* The orphan record's transaction has * committed. We can cleanse this buffer */ clear_buffer_jbddirty (bh); +__jbd2_journal_remove_checkpoint (jh); goto zap_buffer; } }
fs/ocfs2/dlm/dlmmaster.c +15 -11
@@ -2456,6 +2456,11 @@ static int dlm_migrate_lockres(struct dlm_ctxt *dlm,spin_lock (&dlm->master_lock); ret =dlm_add_migration_mle (dlm, res, mle, &oldmle, name, namelen, target, dlm->node_num); +/* get an extra reference on the mle. +* otherwise the assert_master from the new +* master will destroy this. +*/ +dlm_get_mle_inuse (mle);spin_unlock (&dlm->master_lock);spin_unlock (&dlm->spinlock);
@@ -2491,6 +2496,7 @@ fail:if (mle_added) {dlm_mle_detach_hb_events (dlm, mle);dlm_put_mle (mle); +dlm_put_mle_inuse (mle); }else if (mle) {kmem_cache_free (dlm_mle_cache, mle); mle =NULL ;
@@ -2508,17 +2514,6 @@ fail:* ensure that all assert_master work is flushed. */ flush_workqueue (dlm->dlm_worker); -/* get an extra reference on the mle. -* otherwise the assert_master from the new -* master will destroy this. -* also, make sure that all callers of dlm_get_mle -* take both dlm->spinlock and dlm->master_lock */ -spin_lock (&dlm->spinlock); -spin_lock (&dlm->master_lock); -dlm_get_mle_inuse (mle); -spin_unlock (&dlm->master_lock); -spin_unlock (&dlm->spinlock); -/* notify new node and send all lock state */ /* call send_one_lockres with migration flag. * this serves as notice to the target node that a
@@ -3246,6 +3241,15 @@ top: mle->new_master != dead_node)continue ; +if (mle->new_master == dead_node && mle->inuse) { +mlog (ML_NOTICE ,"%s: target %u died during " +"migration from %u, the MLE is " +"still keep used, ignore it!\n" , + dlm->name, dead_node, + mle->master); +continue ; + } +/* If we have reached this point, this mle needs to be * removed from the list and freed. */ dlm_clean_migration_mle (dlm, mle);
fs/ocfs2/dlm/dlmrecovery.c +2 -0
@@ -2326,6 +2326,8 @@ static void dlm_do_local_recovery_cleanup(struct dlm_ctxt *dlm, u8 dead_node)break ; } } +dlm_lockres_clear_refmap_bit (dlm, res, + dead_node);spin_unlock (&res->spinlock);continue ; }
fs/sysv/inode.c +2 -8
@@ -161,14 +161,8 @@ void sysv_set_inode(struct inode *inode, dev_t rdev) inode->i_fop = &sysv_dir_operations; inode->i_mapping->a_ops = &sysv_aops; }else if (S_ISLNK (inode->i_mode)) { -if (inode->i_blocks) { - inode->i_op = &sysv_symlink_inode_operations; - inode->i_mapping->a_ops = &sysv_aops; - }else { - inode->i_op = &sysv_fast_symlink_inode_operations; -nd_terminate_link (SYSV_I (inode)->i_data, inode->i_size, -sizeof (SYSV_I (inode)->i_data) -1 ); - } + inode->i_op = &sysv_symlink_inode_operations; + inode->i_mapping->a_ops = &sysv_aops; }else init_special_inode (inode, inode->i_mode, rdev); }
include/crypto/if_alg.h +3 -5
@@ -30,6 +30,8 @@ struct alg_sock {struct sock *parent; +unsigned int refcnt; +const struct af_alg_type *type;void *private; };
@@ -64,6 +66,7 @@ int af_alg_register_type(const struct af_alg_type *type);int af_alg_unregister_type (const struct af_alg_type *type);int af_alg_release (struct socket *sock); +void af_alg_release_parent (struct sock *sk);int af_alg_accept (struct sock *sk,struct socket *newsock); int af_alg_make_sg(struct af_alg_sgl *sgl, void __user *addr, int len,
@@ -80,11 +83,6 @@ static inline struct alg_sock *alg_sk(struct sock *sk)return (struct alg_sock *)sk; } -static inline void af_alg_release_parent (struct sock *sk) -{ -sock_put (alg_sk (sk)->parent); -} -static inline void af_alg_init_completion (struct af_alg_completion *completion) {init_completion (&completion->completion);
include/linux/signal.h +0 -1
@@ -247,7 +247,6 @@ extern int sigprocmask(int, sigset_t *, sigset_t *);extern void set_current_blocked (sigset_t *);extern void __set_current_blocked (const sigset_t *);extern int show_unhandled_signals; -extern int sigsuspend (sigset_t *);struct sigaction {#ifndef __ARCH_HAS_IRIX_SIGACTION
kernel/signal.c +1 -1
@@ -3551,7 +3551,7 @@ SYSCALL_DEFINE0(pause)#endif -int sigsuspend (sigset_t *set) +static int sigsuspend (sigset_t *set) { current->saved_sigmask = current->blocked;set_current_blocked (set);
scripts/recordmcount.h +1 -1
@@ -377,7 +377,7 @@ static void nop_mcount(Elf_Shdr const *const relhdr,if (mcountsym ==Elf_r_sym (relp) && !is_fake_mcount (relp)) {if (make_nop) - ret =make_nop ((void *)ehdr, shdr->sh_offset + relp->r_offset); + ret =make_nop ((void *)ehdr,_w (shdr->sh_offset) +_w (relp->r_offset));if (warn_on_notrace_sect && !once) {printf ("Section %s has mcount callers being ignored\n" , txtname);
sound/core/compress_offload.c +11 -0
@@ -44,6 +44,13 @@#include <sound/compress_offload.h> #include <sound/compress_driver.h> +/* struct snd_compr_codec_caps overflows the ioctl bit size for some +* architectures, so we need to disable the relevant ioctls. +*/ +#if _IOC_SIZEBITS <14 +#define COMPR_CODEC_CAPS_OVERFLOW +#endif +/* TODO: * - add substream support for multiple devices in case of * SND_DYNAMIC_MINORS is not used
@@ -427,6 +434,7 @@ out:return retval; } +#ifndef COMPR_CODEC_CAPS_OVERFLOW static int snd_compr_get_codec_caps (struct snd_compr_stream *stream,unsigned long arg) {
@@ -450,6 +458,7 @@ out:kfree (caps);return retval; } +#endif /* !COMPR_CODEC_CAPS_OVERFLOW */ /* revisit this with snd_pcm_preallocate_xxx */ static int snd_compr_allocate_buffer(struct snd_compr_stream *stream,
@@ -791,9 +800,11 @@ static long snd_compr_ioctl(struct file *f, unsigned int cmd, unsigned long arg)case _IOC_NR (SNDRV_COMPRESS_GET_CAPS ): retval =snd_compr_get_caps (stream, arg);break ; +#ifndef COMPR_CODEC_CAPS_OVERFLOW case _IOC_NR (SNDRV_COMPRESS_GET_CODEC_CAPS ): retval =snd_compr_get_codec_caps (stream, arg);break ; +#endif case _IOC_NR (SNDRV_COMPRESS_SET_PARAMS ): retval =snd_compr_set_params (stream, arg);break ;
sound/core/oss/pcm_oss.c +15 -6
@@ -834,7 +834,8 @@ static int choose_rate(struct snd_pcm_substream *substream,return snd_pcm_hw_param_near (substream, params,SNDRV_PCM_HW_PARAM_RATE , best_rate,NULL ); } -static int snd_pcm_oss_change_params (struct snd_pcm_substream *substream) +static int snd_pcm_oss_change_params (struct snd_pcm_substream *substream, +bool trylock) {struct snd_pcm_runtime *runtime = substream->runtime;struct snd_pcm_hw_params *params, *sparams;
@@ -848,7 +849,10 @@ static int snd_pcm_oss_change_params(struct snd_pcm_substream *substream)struct snd_mask sformat_mask;struct snd_mask mask; -if (mutex_lock_interruptible (&runtime->oss.params_lock)) +if (trylock) { +if (!(mutex_trylock (&runtime->oss.params_lock))) +return -EAGAIN ; + }else if (mutex_lock_interruptible (&runtime->oss.params_lock))return -EINTR ; sw_params =kmalloc (sizeof (*sw_params),GFP_KERNEL ); params =kmalloc (sizeof (*params),GFP_KERNEL );
@@ -1091,7 +1095,7 @@ static int snd_pcm_oss_get_active_substream(struct snd_pcm_oss_file *pcm_oss_filif (asubstream ==NULL ) asubstream = substream;if (substream->runtime->oss.params) { - err =snd_pcm_oss_change_params (substream); + err =snd_pcm_oss_change_params (substream, false);if (err <0 )return err; }
@@ -1130,7 +1134,7 @@ static int snd_pcm_oss_make_ready(struct snd_pcm_substream *substream)return 0 ; runtime = substream->runtime;if (runtime->oss.params) { - err =snd_pcm_oss_change_params (substream); + err =snd_pcm_oss_change_params (substream, false);if (err <0 )return err; }
@@ -2168,7 +2172,7 @@ static int snd_pcm_oss_get_space(struct snd_pcm_oss_file *pcm_oss_file, int stre runtime = substream->runtime;if (runtime->oss.params && - (err =snd_pcm_oss_change_params (substream)) <0 ) + (err =snd_pcm_oss_change_params (substream, false)) <0 )return err; info.fragsize = runtime->oss.period_bytes;
@@ -2804,7 +2808,12 @@ static int snd_pcm_oss_mmap(struct file *file, struct vm_area_struct *area)return -EIO ;if (runtime->oss.params) { -if ((err =snd_pcm_oss_change_params (substream)) <0 ) +/* use mutex_trylock() for params_lock for avoiding a deadlock +* between mmap_sem and params_lock taken by +* copy_from/to_user() in snd_pcm_oss_write/read() +*/ + err =snd_pcm_oss_change_params (substream, true); +if (err <0 )return err; }#ifdef CONFIG_SND_PCM_OSS_PLUGINS
sound/core/rawmidi.c +23 -13
@@ -934,31 +934,36 @@ static long snd_rawmidi_kernel_read1(struct snd_rawmidi_substream *substream,unsigned long flags;long result =0 , count1;struct snd_rawmidi_runtime *runtime = substream->runtime; +unsigned long appl_ptr; +spin_lock_irqsave (&runtime->lock, flags);while (count >0 && runtime->avail) { count1 = runtime->buffer_size - runtime->appl_ptr;if (count1 > count) count1 = count; -spin_lock_irqsave (&runtime->lock, flags);if (count1 > (int )runtime->avail) count1 = runtime->avail; + +/* update runtime->appl_ptr before unlocking for userbuf */ + appl_ptr = runtime->appl_ptr; + runtime->appl_ptr += count1; + runtime->appl_ptr %= runtime->buffer_size; + runtime->avail -= count1; +if (kernelbuf) -memcpy (kernelbuf + result, runtime->buffer + runtime->appl_ptr, count1); +memcpy (kernelbuf + result, runtime->buffer + appl_ptr, count1);if (userbuf) {spin_unlock_irqrestore (&runtime->lock, flags);if (copy_to_user (userbuf + result, - runtime->buffer + runtime->appl_ptr, count1)) { + runtime->buffer + appl_ptr, count1)) {return result >0 ? result : -EFAULT ; }spin_lock_irqsave (&runtime->lock, flags); } - runtime->appl_ptr += count1; - runtime->appl_ptr %= runtime->buffer_size; - runtime->avail -= count1; -spin_unlock_irqrestore (&runtime->lock, flags); result += count1; count -= count1; } +spin_unlock_irqrestore (&runtime->lock, flags);return result; }
@@ -1161,8 +1166,9 @@ static long snd_rawmidi_kernel_write1(struct snd_rawmidi_substream *substream,unsigned long flags;long count1, result;struct snd_rawmidi_runtime *runtime = substream->runtime; +unsigned long appl_ptr; -if (snd_BUG_ON (!kernelbuf && !userbuf)) +if (!kernelbuf && !userbuf)return -EINVAL ;if (snd_BUG_ON (!runtime->buffer))return -EINVAL ;
@@ -1181,12 +1187,19 @@ static long snd_rawmidi_kernel_write1(struct snd_rawmidi_substream *substream, count1 = count;if (count1 > (long )runtime->avail) count1 = runtime->avail; + +/* update runtime->appl_ptr before unlocking for userbuf */ + appl_ptr = runtime->appl_ptr; + runtime->appl_ptr += count1; + runtime->appl_ptr %= runtime->buffer_size; + runtime->avail -= count1; +if (kernelbuf) -memcpy (runtime->buffer + runtime->appl_ptr, +memcpy (runtime->buffer + appl_ptr, kernelbuf + result, count1);else if (userbuf) {spin_unlock_irqrestore (&runtime->lock, flags); -if (copy_from_user (runtime->buffer + runtime->appl_ptr, +if (copy_from_user (runtime->buffer + appl_ptr, userbuf + result, count1)) {spin_lock_irqsave (&runtime->lock, flags); result = result >0 ? result : -EFAULT ;
@@ -1194,9 +1207,6 @@ static long snd_rawmidi_kernel_write1(struct snd_rawmidi_substream *substream, }spin_lock_irqsave (&runtime->lock, flags); } - runtime->appl_ptr += count1; - runtime->appl_ptr %= runtime->buffer_size; - runtime->avail -= count1; result += count1; count -= count1; }
sound/core/seq/oss/seq_oss_synth.c +1 -1
@@ -310,7 +310,7 @@ snd_seq_oss_synth_cleanup(struct seq_oss_devinfo *dp)struct seq_oss_synth *rec;struct seq_oss_synthinfo *info; -if (snd_BUG_ON (dp->max_synthdev >=SNDRV_SEQ_OSS_MAX_SYNTH_DEVS )) +if (snd_BUG_ON (dp->max_synthdev >SNDRV_SEQ_OSS_MAX_SYNTH_DEVS ))return ;for (i =0 ; i < dp->max_synthdev; i++) { info = &dp->synths[i];
sound/core/seq/seq_clientmgr.c +3 -0
@@ -678,6 +678,9 @@ static int deliver_to_subscribers(struct snd_seq_client *client,else down_read (&grp->list_mutex);list_for_each_entry (subs, &grp->list_head, src_list) { +/* both ports ready? */ +if (atomic_read (&subs->ref_count) !=2 ) +continue ; event->dest = subs->info.dest;if (subs->info.flags &SNDRV_SEQ_PORT_SUBS_TIMESTAMP )/* convert time according to flag with subscription */
sound/core/seq/seq_ports.c +130 -103
319 lines not on this page · raw message
sound/core/seq/seq_timer.c +67 -20
187 lines not on this page · raw message
sound/core/seq/seq_virmidi.c +5 -1
@@ -254,9 +254,13 @@ static int snd_virmidi_output_open(struct snd_rawmidi_substream *substream)*/ static int snd_virmidi_input_close (struct snd_rawmidi_substream *substream) { +struct snd_virmidi_dev *rdev = substream->rmidi->private_data;struct snd_virmidi *vmidi = substream->runtime->private_data; -snd_midi_event_free (vmidi->parser); + +write_lock_irq (&rdev->filelist_lock);list_del (&vmidi->list); +write_unlock_irq (&rdev->filelist_lock); +snd_midi_event_free (vmidi->parser); substream->runtime->private_data =NULL ;kfree (vmidi);return 0 ;
sound/core/timer.c +44 -20
155 lines not on this page · raw message
sound/drivers/dummy.c +18 -17
@@ -109,6 +109,9 @@ struct dummy_timer_ops {snd_pcm_uframes_t (*pointer)(struct snd_pcm_substream *); }; +#define get_dummy_ops (substream) \ + (*(const struct dummy_timer_ops **)(substream)->runtime->private_data) +struct dummy_model {const char *name;int (*playback_constraints)(struct snd_pcm_runtime *runtime);
@@ -137,7 +140,6 @@ struct snd_dummy {int iobox;struct snd_kcontrol *cd_volume_ctl;struct snd_kcontrol *cd_switch_ctl; -const struct dummy_timer_ops *timer_ops; };/*
@@ -231,6 +233,8 @@ struct dummy_model *dummy_models[] = {*/ struct dummy_systimer_pcm { +/* ops must be the first item */ +const struct dummy_timer_ops *timer_ops;spinlock_t lock;struct timer_list timer;unsigned long base_time;
@@ -368,6 +372,8 @@ static struct dummy_timer_ops dummy_systimer_ops = {*/ struct dummy_hrtimer_pcm { +/* ops must be the first item */ +const struct dummy_timer_ops *timer_ops;ktime_t base_time;ktime_t period_time;atomic_t running;
@@ -494,31 +500,25 @@ static struct dummy_timer_ops dummy_hrtimer_ops = {static int dummy_pcm_trigger (struct snd_pcm_substream *substream,int cmd) { -struct snd_dummy *dummy =snd_pcm_substream_chip (substream); -switch (cmd) {case SNDRV_PCM_TRIGGER_START :case SNDRV_PCM_TRIGGER_RESUME : -return dummy->timer_ops->start (substream); +return get_dummy_ops (substream)->start (substream);case SNDRV_PCM_TRIGGER_STOP :case SNDRV_PCM_TRIGGER_SUSPEND : -return dummy->timer_ops->stop (substream); +return get_dummy_ops (substream)->stop (substream); }return -EINVAL ; }static int dummy_pcm_prepare (struct snd_pcm_substream *substream) { -struct snd_dummy *dummy =snd_pcm_substream_chip (substream); - -return dummy->timer_ops->prepare (substream); +return get_dummy_ops (substream)->prepare (substream); }static snd_pcm_uframes_t dummy_pcm_pointer (struct snd_pcm_substream *substream) { -struct snd_dummy *dummy =snd_pcm_substream_chip (substream); - -return dummy->timer_ops->pointer (substream); +return get_dummy_ops (substream)->pointer (substream); }static struct snd_pcm_hardware dummy_pcm_hardware = {
@@ -564,17 +564,19 @@ static int dummy_pcm_open(struct snd_pcm_substream *substream)struct snd_dummy *dummy =snd_pcm_substream_chip (substream);struct dummy_model *model = dummy->model;struct snd_pcm_runtime *runtime = substream->runtime; +const struct dummy_timer_ops *ops;int err; - dummy->timer_ops = &dummy_systimer_ops; + ops = &dummy_systimer_ops;#ifdef CONFIG_HIGH_RES_TIMERS if (hrtimer) - dummy->timer_ops = &dummy_hrtimer_ops; + ops = &dummy_hrtimer_ops;#endif - err = dummy->timer_ops->create (substream); + err = ops->create (substream);if (err <0 )return err; +get_dummy_ops (substream) = ops; runtime->hw = dummy->pcm_hw;if (substream->pcm->device &1 ) {
@@ -596,7 +598,7 @@ static int dummy_pcm_open(struct snd_pcm_substream *substream) err = model->capture_constraints (substream->runtime); }if (err <0 ) { - dummy->timer_ops->free (substream); +get_dummy_ops (substream)->free (substream);return err; }return 0 ;
@@ -604,8 +606,7 @@ static int dummy_pcm_open(struct snd_pcm_substream *substream)static int dummy_pcm_close (struct snd_pcm_substream *substream) { -struct snd_dummy *dummy =snd_pcm_substream_chip (substream); - dummy->timer_ops->free (substream); +get_dummy_ops (substream)->free (substream);return 0 ; }
sound/pci/hda/patch_realtek.c +1 -0
@@ -2188,6 +2188,7 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = {SND_PCI_QUIRK (0x104d ,0x9047 ,"Sony Vaio TT" ,ALC889_FIXUP_VAIO_TT ),SND_PCI_QUIRK (0x104d ,0x905a ,"Sony Vaio Z" ,ALC882_FIXUP_NO_PRIMARY_HP ),SND_PCI_QUIRK (0x104d ,0x9043 ,"Sony Vaio VGC-LN51JGB" ,ALC882_FIXUP_NO_PRIMARY_HP ), +SND_PCI_QUIRK (0x104d ,0x9044 ,"Sony VAIO AiO" ,ALC882_FIXUP_NO_PRIMARY_HP ),/* All Apple entries are in codec SSIDs */ SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF),
sound/soc/soc-pcm.c +2 -1
@@ -1248,7 +1248,8 @@ static int dpcm_be_dai_hw_free(struct snd_soc_pcm_runtime *fe, int stream) (be->dpcm[stream].state !=SND_SOC_DPCM_STATE_PREPARE ) && (be->dpcm[stream].state !=SND_SOC_DPCM_STATE_HW_FREE ) && (be->dpcm[stream].state !=SND_SOC_DPCM_STATE_PAUSED ) && - (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP)) + (be->dpcm[stream].state !=SND_SOC_DPCM_STATE_STOP ) && + (be->dpcm[stream].state != SND_SOC_DPCM_STATE_SUSPEND)) continue; dev_dbg(be->dev, "ASoC: hw_free BE %s\n",
sound/usb/midi.c +0 -1
@@ -2291,7 +2291,6 @@ int snd_usbmidi_create(struct snd_card *card,else err =snd_usbmidi_create_endpoints (umidi, endpoints);if (err <0 ) { -snd_usbmidi_free (umidi);return err; }
sound/usb/quirks.c +13 -1
@@ -900,8 +900,12 @@ void snd_usb_set_interface_quirk(struct usb_device *dev)* "Playback Design" products need a 50ms delay after setting the * USB interface. */ -if (le16_to_cpu (dev->descriptor.idVendor) ==0x23ba ) +switch (le16_to_cpu (dev->descriptor.idVendor)) { +case 0x23ba :/* Playback Design */ +case 0x0644 :/* TEAC Corp. */ mdelay (50 ); +break ; + } } void snd_usb_ctl_msg_quirk(struct usb_device *dev, unsigned int pipe,
@@ -916,6 +920,14 @@ void snd_usb_ctl_msg_quirk(struct usb_device *dev, unsigned int pipe, (requesttype & USB_TYPE_MASK) == USB_TYPE_CLASS)mdelay (20 ); +/* +* "TEAC Corp." products need a 20ms delay after each +* class compliant request +*/ +if ((le16_to_cpu (dev->descriptor.idVendor) ==0x0644 ) && + (requesttype &USB_TYPE_MASK ) ==USB_TYPE_CLASS ) +mdelay (20 ); +/* Marantz/Denon devices with USB DAC functionality need a delay * after each class compliant request */