media fixes for v4.12-rc6

-----BEGIN PGP SIGNATURE-----
 
 iQIcBAABAgAGBQJZP/n4AAoJEAhfPr2O5OEVncwQAIRVoe3ayA4inwyg3zNWHtU/
 iBUMg+I3dlUgOl8bJfJni+2u3vOypjpkNibq32kiZ/dfdkxQWuUqY/pjam0Wrocr
 oPgcHdYdUNkwCA6N2nX2kQpY6fHOkHDjaDA4wrgMMUMhB83Qs+Vv/hLXPZ6EnJyF
 qLUyh/I4MApMeE9YRMeTLfG/4eKGDpQGdwbBLzwIMrG4jGo5POImw9QP6C9AmHoC
 aMevNpqPyCp/uY35ga3SBwfSLNYx1OiMnsMjodse5ccr9J02lU5Fs7DaqZ33FtTS
 qr3P/ZfREy7rNk2LBvbIWKe8Qfa1IeX+XaBp8TCt8/RXCXc4/WNBoLOAh2cIwkpL
 xyBz/gcZ2nPFIPRdXZei+c1pkCgqriuV5viHcycVKoHdpwNGNJ1xmYHhP/xopNyC
 H5XZ2iefyW+PJRLhif9a74KxnKx/6VzJv6PQDgY33BDjN+G8pQFX3W2Ty0WdwRL3
 PWAZJML74WLmbjhwvJlhpWk6RdyK72MEsJdB0AK3k+J1O6HBmUD6QFzq04ZV1Eal
 8PSWm9waMB/6qEtqvaVm9Y+/NuCJD0uawa+2U7ryiIuNMZmSwgJIyDLjFfpkEHED
 5QjvKYrBXKImFfn1tDmqkCPDqCAVBqy9GuSBpD4MnK4Jn/Hw8p2YRO7LEMSuKsdp
 wFHyVW0soaPSNUoYdrJG
 =GEtG
 -----END PGP SIGNATURE-----

Merge tag 'media/v4.12-3' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media

Pull media fixes from Mauro Carvalho Chehab:

 - some build dependency issues at CEC core with randconfigs

 - fix an off by one error at vb2

 - a race fix at cec core

 - driver fixes at tc358743, sir_ir and rainshadow-cec

* tag 'media/v4.12-3' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media:
  [media] media/cec.h: use IS_REACHABLE instead of IS_ENABLED
  [media] cec: race fix: don't return -ENONET in cec_receive()
  [media] sir_ir: infinite loop in interrupt handler
  [media] cec-notifier.h: handle unreachable CONFIG_CEC_CORE
  [media] cec: improve MEDIA_CEC_RC dependencies
  [media] vb2: Fix an off by one error in 'vb2_plane_vaddr'
  [media] rainshadow-cec: Fix missing spin_lock_init()
  [media] tc358743: fix register i2c_rd/wr function fix
This commit is contained in:
Linus Torvalds 2017-06-15 17:37:40 +09:00
commit 906e0c5b9f
8 changed files with 22 additions and 10 deletions

View File

@ -1,5 +1,6 @@
config MEDIA_CEC_RC config MEDIA_CEC_RC
bool "HDMI CEC RC integration" bool "HDMI CEC RC integration"
depends on CEC_CORE && RC_CORE depends on CEC_CORE && RC_CORE
depends on CEC_CORE=m || RC_CORE=y
---help--- ---help---
Pass on CEC remote control messages to the RC framework. Pass on CEC remote control messages to the RC framework.

View File

@ -271,16 +271,10 @@ static long cec_receive(struct cec_adapter *adap, struct cec_fh *fh,
bool block, struct cec_msg __user *parg) bool block, struct cec_msg __user *parg)
{ {
struct cec_msg msg = {}; struct cec_msg msg = {};
long err = 0; long err;
if (copy_from_user(&msg, parg, sizeof(msg))) if (copy_from_user(&msg, parg, sizeof(msg)))
return -EFAULT; return -EFAULT;
mutex_lock(&adap->lock);
if (!adap->is_configured && fh->mode_follower < CEC_MODE_MONITOR)
err = -ENONET;
mutex_unlock(&adap->lock);
if (err)
return err;
err = cec_receive_msg(fh, &msg, block); err = cec_receive_msg(fh, &msg, block);
if (err) if (err)

View File

@ -223,7 +223,7 @@ static void i2c_wr8(struct v4l2_subdev *sd, u16 reg, u8 val)
static void i2c_wr8_and_or(struct v4l2_subdev *sd, u16 reg, static void i2c_wr8_and_or(struct v4l2_subdev *sd, u16 reg,
u8 mask, u8 val) u8 mask, u8 val)
{ {
i2c_wrreg(sd, reg, (i2c_rdreg(sd, reg, 2) & mask) | val, 2); i2c_wrreg(sd, reg, (i2c_rdreg(sd, reg, 1) & mask) | val, 1);
} }
static u16 i2c_rd16(struct v4l2_subdev *sd, u16 reg) static u16 i2c_rd16(struct v4l2_subdev *sd, u16 reg)

View File

@ -183,9 +183,15 @@ static irqreturn_t sir_interrupt(int irq, void *dev_id)
static unsigned long delt; static unsigned long delt;
unsigned long deltintr; unsigned long deltintr;
unsigned long flags; unsigned long flags;
int counter = 0;
int iir, lsr; int iir, lsr;
while ((iir = inb(io + UART_IIR) & UART_IIR_ID)) { while ((iir = inb(io + UART_IIR) & UART_IIR_ID)) {
if (++counter > 256) {
dev_err(&sir_ir_dev->dev, "Trapped in interrupt");
break;
}
switch (iir & UART_IIR_ID) { /* FIXME toto treba preriedit */ switch (iir & UART_IIR_ID) { /* FIXME toto treba preriedit */
case UART_IIR_MSI: case UART_IIR_MSI:
(void)inb(io + UART_MSR); (void)inb(io + UART_MSR);

View File

@ -336,6 +336,7 @@ static int rain_connect(struct serio *serio, struct serio_driver *drv)
serio_set_drvdata(serio, rain); serio_set_drvdata(serio, rain);
INIT_WORK(&rain->work, rain_irq_work_handler); INIT_WORK(&rain->work, rain_irq_work_handler);
mutex_init(&rain->write_lock); mutex_init(&rain->write_lock);
spin_lock_init(&rain->buf_lock);
err = serio_open(serio, drv); err = serio_open(serio, drv);
if (err) if (err)

View File

@ -868,7 +868,7 @@ EXPORT_SYMBOL_GPL(vb2_core_create_bufs);
void *vb2_plane_vaddr(struct vb2_buffer *vb, unsigned int plane_no) void *vb2_plane_vaddr(struct vb2_buffer *vb, unsigned int plane_no)
{ {
if (plane_no > vb->num_planes || !vb->planes[plane_no].mem_priv) if (plane_no >= vb->num_planes || !vb->planes[plane_no].mem_priv)
return NULL; return NULL;
return call_ptr_memop(vb, vaddr, vb->planes[plane_no].mem_priv); return call_ptr_memop(vb, vaddr, vb->planes[plane_no].mem_priv);

View File

@ -106,6 +106,16 @@ static inline void cec_notifier_set_phys_addr_from_edid(struct cec_notifier *n,
{ {
} }
static inline void cec_notifier_register(struct cec_notifier *n,
struct cec_adapter *adap,
void (*callback)(struct cec_adapter *adap, u16 pa))
{
}
static inline void cec_notifier_unregister(struct cec_notifier *n)
{
}
#endif #endif
#endif #endif

View File

@ -206,7 +206,7 @@ static inline bool cec_is_sink(const struct cec_adapter *adap)
#define cec_phys_addr_exp(pa) \ #define cec_phys_addr_exp(pa) \
((pa) >> 12), ((pa) >> 8) & 0xf, ((pa) >> 4) & 0xf, (pa) & 0xf ((pa) >> 12), ((pa) >> 8) & 0xf, ((pa) >> 4) & 0xf, (pa) & 0xf
#if IS_ENABLED(CONFIG_CEC_CORE) #if IS_REACHABLE(CONFIG_CEC_CORE)
struct cec_adapter *cec_allocate_adapter(const struct cec_adap_ops *ops, struct cec_adapter *cec_allocate_adapter(const struct cec_adap_ops *ops,
void *priv, const char *name, u32 caps, u8 available_las); void *priv, const char *name, u32 caps, u8 available_las);
int cec_register_adapter(struct cec_adapter *adap, struct device *parent); int cec_register_adapter(struct cec_adapter *adap, struct device *parent);