/* * Copyright 2006 IBM Corporation * IUCV protocol stack for Linux on zSeries * Version 1.0 * Author(s): Jennifer Hunt * */ #ifndef __AFIUCV_H #define __AFIUCV_H #include #include #include #include #include #include #ifndef AF_IUCV #define AF_IUCV 32 #define PF_IUCV AF_IUCV #endif /* Connection and socket states */ enum { IUCV_CONNECTED = 1, IUCV_OPEN, IUCV_BOUND, IUCV_LISTEN, IUCV_DISCONN, IUCV_CLOSING, IUCV_CLOSED }; #define IUCV_QUEUELEN_DEFAULT 65535 #define IUCV_HIPER_MSGLIM_DEFAULT 128 #define IUCV_CONN_TIMEOUT (HZ * 40) #define IUCV_DISCONN_TIMEOUT (HZ * 2) #define IUCV_CONN_IDLE_TIMEOUT (HZ * 60) #define IUCV_BUFSIZE_DEFAULT 32768 /* IUCV socket address */ struct sockaddr_iucv { sa_family_t siucv_family; unsigned short siucv_port; /* Reserved */ unsigned int siucv_addr; /* Reserved */ char siucv_nodeid[8]; /* Reserved */ char siucv_user_id[8]; /* Guest User Id */ char siucv_name[8]; /* Application Name */ }; /* Common socket structures and functions */ struct sock_msg_q { struct iucv_path *path; struct iucv_message msg; struct list_head list; spinlock_t lock; }; #define AF_IUCV_FLAG_ACK 0x1 #define AF_IUCV_FLAG_SYN 0x2 #define AF_IUCV_FLAG_FIN 0x4 #define AF_IUCV_FLAG_WIN 0x8 #define AF_IUCV_FLAG_SHT 0x10 struct af_iucv_trans_hdr { u16 magic; u8 version; u8 flags; u16 window; char destNodeID[8]; char destUserID[8]; char destAppName[16]; char srcNodeID[8]; char srcUserID[8]; char srcAppName[16]; /* => 70 bytes */ struct iucv_message iucv_hdr; /* => 33 bytes */ u8 pad; /* total 104 bytes */ } __packed; enum iucv_tx_notify { /* transmission of skb is completed and was successful */ TX_NOTIFY_OK = 0, /* target is unreachable */ TX_NOTIFY_UNREACHABLE = 1, /* transfer pending queue full */ TX_NOTIFY_TPQFULL = 2, /* general error */ TX_NOTIFY_GENERALERROR = 3, /* transmission of skb is pending - may interleave * with TX_NOTIFY_DELAYED_* */ TX_NOTIFY_PENDING = 4, /* transmission of skb was done successfully (delayed) */ TX_NOTIFY_DELAYED_OK = 5, /* target unreachable (detected delayed) */ TX_NOTIFY_DELAYED_UNREACHABLE = 6, /* general error (detected delayed) */ TX_NOTIFY_DELAYED_GENERALERROR = 7, }; #define iucv_sk(__sk) ((struct iucv_sock *) __sk) #define AF_IUCV_TRANS_IUCV 0 #define AF_IUCV_TRANS_HIPER 1 struct iucv_sock { struct sock sk; char src_user_id[8]; char src_name[8]; char dst_user_id[8]; char dst_name[8]; struct list_head accept_q; spinlock_t accept_q_lock; struct sock *parent; struct iucv_path *path; struct net_device *hs_dev; struct sk_buff_head send_skb_q; struct sk_buff_head backlog_skb_q; struct sock_msg_q message_q; unsigned int send_tag; u8 flags; u16 msglimit; u16 msglimit_peer; atomic_t msg_sent; atomic_t msg_recv; atomic_t pendings; int transport; void (*sk_txnotify)(struct sk_buff *skb, enum iucv_tx_notify n); }; struct iucv_skb_cb { u32 class; /* target class of message */ u32 tag; /* tag associated with message */ u32 offset; /* offset for skb receival */ }; #define IUCV_SKB_CB(__skb) ((struct iucv_skb_cb *)&((__skb)->cb[0])) /* iucv socket options (SOL_IUCV) */ #define SO_IPRMDATA_MSG 0x0080 /* send/recv IPRM_DATA msgs */ #define SO_MSGLIMIT 0x1000 /* get/set IUCV MSGLIMIT */ #define SO_MSGSIZE 0x0800 /* get maximum msgsize */ /* iucv related control messages (scm) */ #define SCM_IUCV_TRGCLS 0x0001 /* target class control message */ struct iucv_sock_list { struct hlist_head head; rwlock_t lock; atomic_t autobind_name; }; unsigned int iucv_sock_poll(struct file *file, struct socket *sock, poll_table *wait); void iucv_sock_link(struct iucv_sock_list *l, struct sock *s); void iucv_sock_unlink(struct iucv_sock_list *l, struct sock *s); void iucv_accept_enqueue(struct sock *parent, struct sock *sk); void iucv_accept_unlink(struct sock *sk); struct sock *iucv_accept_dequeue(struct sock *parent, struct socket *newsock); #endif /* __IUCV_H */ nchange='this.form.submit();'>mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-01-29 13:50:06 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2017-01-29 13:50:06 -0800
commit39cb2c9a316e77f6dfba96c543e55b6672d5a37e (patch)
tree98fe974ee4e20121253de7f61fc8d01bdb3821c1 /include/trace/events/mce.h
parent2c5d9555d6d937966d79d4c6529a5f7b9206e405 (diff)
drm/i915: Check for NULL i915_vma in intel_unpin_fb_obj()
I've seen this trigger twice now, where the i915_gem_object_to_ggtt() call in intel_unpin_fb_obj() returns NULL, resulting in an oops immediately afterwards as the (inlined) call to i915_vma_unpin_fence() tries to dereference it. It seems to be some race condition where the object is going away at shutdown time, since both times happened when shutting down the X server. The call chains were different: - VT ioctl(KDSETMODE, KD_TEXT): intel_cleanup_plane_fb+0x5b/0xa0 [i915] drm_atomic_helper_cleanup_planes+0x6f/0x90 [drm_kms_helper] intel_atomic_commit_tail+0x749/0xfe0 [i915] intel_atomic_commit+0x3cb/0x4f0 [i915] drm_atomic_commit+0x4b/0x50 [drm] restore_fbdev_mode+0x14c/0x2a0 [drm_kms_helper] drm_fb_helper_restore_fbdev_mode_unlocked+0x34/0x80 [drm_kms_helper] drm_fb_helper_set_par+0x2d/0x60 [drm_kms_helper] intel_fbdev_set_par+0x18/0x70 [i915] fb_set_var+0x236/0x460 fbcon_blank+0x30f/0x350 do_unblank_screen+0xd2/0x1a0 vt_ioctl+0x507/0x12a0 tty_ioctl+0x355/0xc30 do_vfs_ioctl+0xa3/0x5e0 SyS_ioctl+0x79/0x90 entry_SYSCALL_64_fastpath+0x13/0x94 - i915 unpin_work workqueue: intel_unpin_work_fn+0x58/0x140 [i915] process_one_work+0x1f1/0x480 worker_thread+0x48/0x4d0 kthread+0x101/0x140 and this patch purely papers over the issue by adding a NULL pointer check and a WARN_ON_ONCE() to avoid the oops that would then generally make the machine unresponsive. Other callers of i915_gem_object_to_ggtt() seem to also check for the returned pointer being NULL and warn about it, so this clearly has happened before in other places. [ Reported it originally to the i915 developers on Jan 8, applying the ugly workaround on my own now after triggering the problem for the second time with no feedback. This is likely to be the same bug reported as https://bugs.freedesktop.org/show_bug.cgi?id=98829 https://bugs.freedesktop.org/show_bug.cgi?id=99134 which has a patch for the underlying problem, but it hasn't gotten to me, so I'm applying the workaround. ] Cc: Daniel Vetter <daniel.vetter@intel.com> Cc: Jani Nikula <jani.nikula@linux.intel.com> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Cc: Imre Deak <imre.deak@intel.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/trace/events/mce.h')