Merge branch 'master' of git://linuxtv.org/media_build

This commit is contained in:
CrazyCat
2021-02-01 17:44:55 +02:00
33 changed files with 158 additions and 1403 deletions

View File

@@ -53,6 +53,7 @@ add v5.5_vb2_kmap.patch
[5.4.255]
add v5.4_revert_spi_transfer.patch
add v5.4_async.patch
[5.1.255]
add v5.1_vm_map_pages.patch
@@ -61,6 +62,7 @@ add v5.1_devm_i2c_new_dummy_device.patch
[5.0.255]
add v5.0_ipu3-cio2.patch
add v5.0_time32.patch
add v5.0_gpio.patch
[4.20.255]
add v4.20_access_ok.patch
@@ -75,6 +77,7 @@ add v4.17_i2c_check_num_msgs.patch
[4.15.255]
add v4.15_pmdown_time.patch
add v4.15_async.patch
[4.14.255]
add v4.14_saa7146_timer_cast.patch
@@ -93,6 +96,7 @@ add v4.12_revert_solo6x10_copykerneluser.patch
[4.11.255]
add v4.11_drop_drm_file.patch
add v4.11_vb2_kmap.patch
add v4.11_pwc.patch
[4.10.255]
add v4.10_sched_signal.patch
@@ -133,52 +137,3 @@ add v4.4_user_pages_flag.patch
[4.3.255]
delete v4.4_user_pages_flag.patch
add v4.3_bt87x_const_fix.patch
[4.2.255]
add v4.2_atomic64.patch
add v4.2_frame_vector.patch
[4.1.255]
add v4.1_pat_enabled.patch
add v4.1_drop_fwnode.patch
[4.0.255]
add v4.0_dma_buf_export.patch
add v4.0_drop_trace.patch
add v4.0_fwnode.patch
[3.19.255]
add v3.19_get_user_pages_unlocked.patch
add v3.19_get_user_pages_locked.patch
[3.18.255]
add v3.18_drop_property_h.patch
add v3.18_ktime_get_real_seconds.patch
[3.17.255]
add v3.17_fix_clamp.patch
add v3.17_remove_bpf_h.patch
[3.16.255]
add v3.16_netdev.patch
add v3.16_wait_on_bit.patch
add v3.16_void_gpiochip_remove.patch
add v3.16_drop_pointing_stick.patch
add v3.16_dma_buf_export.patch
[3.13.255]
add v3.13_ddbridge_pcimsi.patch
[3.12.255]
add v3.12_kfifo_in.patch
[3.11.255]
add v3.11_dev_groups.patch
add v3.11_vidtv.patch
[3.10.255]
add v3.10_fw_driver_probe.patch
add v3.10_ir_hix5hd2.patch
add v3.10_const_snd_pcm_ops.patch
[3.9.255]

View File

@@ -1,169 +0,0 @@
diff --git a/drivers/media/pci/cx18/cx18-alsa-pcm.c b/drivers/media/pci/cx18/cx18-alsa-pcm.c
index 4f31042..c40558c 100644
--- a/drivers/media/pci/cx18/cx18-alsa-pcm.c
+++ b/drivers/media/pci/cx18/cx18-alsa-pcm.c
@@ -308,7 +308,7 @@ static struct page *snd_pcm_get_vmalloc_page(struct snd_pcm_substream *subs,
return vmalloc_to_page(pageptr);
}
-static const struct snd_pcm_ops snd_cx18_pcm_capture_ops = {
+static struct snd_pcm_ops snd_cx18_pcm_capture_ops = {
.open = snd_cx18_pcm_capture_open,
.close = snd_cx18_pcm_capture_close,
.ioctl = snd_cx18_pcm_ioctl,
diff --git a/drivers/media/pci/cx23885/cx23885-alsa.c b/drivers/media/pci/cx23885/cx23885-alsa.c
index 20b3cb1..07f0734 100644
--- a/drivers/media/pci/cx23885/cx23885-alsa.c
+++ b/drivers/media/pci/cx23885/cx23885-alsa.c
@@ -501,7 +501,7 @@ static struct page *snd_cx23885_page(struct snd_pcm_substream *substream,
/*
* operators
*/
-static const struct snd_pcm_ops snd_cx23885_pcm_ops = {
+static struct snd_pcm_ops snd_cx23885_pcm_ops = {
.open = snd_cx23885_pcm_open,
.close = snd_cx23885_close,
.ioctl = snd_pcm_lib_ioctl,
diff --git a/drivers/media/pci/cx25821/cx25821-alsa.c b/drivers/media/pci/cx25821/cx25821-alsa.c
index 42ba764..f2684ee 100644
--- a/drivers/media/pci/cx25821/cx25821-alsa.c
+++ b/drivers/media/pci/cx25821/cx25821-alsa.c
@@ -646,7 +646,7 @@ static struct page *snd_cx25821_page(struct snd_pcm_substream *substream,
/*
* operators
*/
-static const struct snd_pcm_ops snd_cx25821_pcm_ops = {
+static struct snd_pcm_ops snd_cx25821_pcm_ops = {
.open = snd_cx25821_pcm_open,
.close = snd_cx25821_close,
.ioctl = snd_pcm_lib_ioctl,
diff --git a/drivers/media/pci/cx88/cx88-alsa.c b/drivers/media/pci/cx88/cx88-alsa.c
index ab09bb5..e6ccf0c 100644
--- a/drivers/media/pci/cx88/cx88-alsa.c
+++ b/drivers/media/pci/cx88/cx88-alsa.c
@@ -591,7 +591,7 @@ static struct page *snd_cx88_page(struct snd_pcm_substream *substream,
/*
* operators
*/
-static const struct snd_pcm_ops snd_cx88_pcm_ops = {
+static struct snd_pcm_ops snd_cx88_pcm_ops = {
.open = snd_cx88_pcm_open,
.close = snd_cx88_close,
.ioctl = snd_pcm_lib_ioctl,
diff --git a/drivers/media/pci/ivtv/ivtv-alsa-pcm.c b/drivers/media/pci/ivtv/ivtv-alsa-pcm.c
index 5326d86..dc59e47 100644
--- a/drivers/media/pci/ivtv/ivtv-alsa-pcm.c
+++ b/drivers/media/pci/ivtv/ivtv-alsa-pcm.c
@@ -313,7 +313,7 @@ static struct page *snd_pcm_get_vmalloc_page(struct snd_pcm_substream *subs,
return vmalloc_to_page(pageptr);
}
-static const struct snd_pcm_ops snd_ivtv_pcm_capture_ops = {
+static struct snd_pcm_ops snd_ivtv_pcm_capture_ops = {
.open = snd_ivtv_pcm_capture_open,
.close = snd_ivtv_pcm_capture_close,
.ioctl = snd_ivtv_pcm_ioctl,
diff --git a/drivers/media/pci/saa7134/saa7134-alsa.c b/drivers/media/pci/saa7134/saa7134-alsa.c
index 7231144..4a5508d 100644
--- a/drivers/media/pci/saa7134/saa7134-alsa.c
+++ b/drivers/media/pci/saa7134/saa7134-alsa.c
@@ -871,7 +871,7 @@ static struct page *snd_card_saa7134_page(struct snd_pcm_substream *substream,
* ALSA capture callbacks definition
*/
-static const struct snd_pcm_ops snd_card_saa7134_capture_ops = {
+static struct snd_pcm_ops snd_card_saa7134_capture_ops = {
.open = snd_card_saa7134_capture_open,
.close = snd_card_saa7134_capture_close,
.ioctl = snd_pcm_lib_ioctl,
diff --git a/drivers/media/pci/tw686x/tw686x-audio.c b/drivers/media/pci/tw686x/tw686x-audio.c
index 7719076..96e444c 100644
--- a/drivers/media/pci/tw686x/tw686x-audio.c
+++ b/drivers/media/pci/tw686x/tw686x-audio.c
@@ -269,7 +269,7 @@ static snd_pcm_uframes_t tw686x_pcm_pointer(struct snd_pcm_substream *ss)
return bytes_to_frames(ss->runtime, ac->ptr);
}
-static const struct snd_pcm_ops tw686x_pcm_ops = {
+static struct snd_pcm_ops tw686x_pcm_ops = {
.open = tw686x_pcm_open,
.close = tw686x_pcm_close,
.ioctl = snd_pcm_lib_ioctl,
diff --git a/drivers/media/usb/cx231xx/cx231xx-audio.c b/drivers/media/usb/cx231xx/cx231xx-audio.c
index d96236d..92a573e 100644
--- a/drivers/media/usb/cx231xx/cx231xx-audio.c
+++ b/drivers/media/usb/cx231xx/cx231xx-audio.c
@@ -631,7 +631,7 @@ static struct page *snd_pcm_get_vmalloc_page(struct snd_pcm_substream *subs,
return vmalloc_to_page(pageptr);
}
-static const struct snd_pcm_ops snd_cx231xx_pcm_capture = {
+static struct snd_pcm_ops snd_cx231xx_pcm_capture = {
.open = snd_cx231xx_capture_open,
.close = snd_cx231xx_pcm_close,
.ioctl = snd_pcm_lib_ioctl,
diff --git a/drivers/media/usb/em28xx/em28xx-audio.c b/drivers/media/usb/em28xx/em28xx-audio.c
index 8e799ae..535d7f7 100644
--- a/drivers/media/usb/em28xx/em28xx-audio.c
+++ b/drivers/media/usb/em28xx/em28xx-audio.c
@@ -705,7 +705,7 @@ static int em28xx_cvol_new(struct snd_card *card, struct em28xx *dev,
/*
* register/unregister code and data
*/
-static const struct snd_pcm_ops snd_em28xx_pcm_capture = {
+static struct snd_pcm_ops snd_em28xx_pcm_capture = {
.open = snd_em28xx_capture_open,
.close = snd_em28xx_pcm_close,
.ioctl = snd_pcm_lib_ioctl,
diff --git a/drivers/media/usb/go7007/snd-go7007.c b/drivers/media/usb/go7007/snd-go7007.c
index f84a213..8e4006ff 100644
--- a/drivers/media/usb/go7007/snd-go7007.c
+++ b/drivers/media/usb/go7007/snd-go7007.c
@@ -198,7 +198,7 @@ static struct page *go7007_snd_pcm_page(struct snd_pcm_substream *substream,
return vmalloc_to_page(substream->runtime->dma_area + offset);
}
-static const struct snd_pcm_ops go7007_snd_capture_ops = {
+static struct snd_pcm_ops go7007_snd_capture_ops = {
.open = go7007_snd_capture_open,
.close = go7007_snd_capture_close,
.ioctl = snd_pcm_lib_ioctl,
diff --git a/drivers/media/usb/tm6000/tm6000-alsa.c b/drivers/media/usb/tm6000/tm6000-alsa.c
index f18cffae..153732f 100644
--- a/drivers/media/usb/tm6000/tm6000-alsa.c
+++ b/drivers/media/usb/tm6000/tm6000-alsa.c
@@ -380,7 +380,7 @@ static struct page *snd_pcm_get_vmalloc_page(struct snd_pcm_substream *subs,
/*
* operators
*/
-static const struct snd_pcm_ops snd_tm6000_pcm_ops = {
+static struct snd_pcm_ops snd_tm6000_pcm_ops = {
.open = snd_tm6000_pcm_open,
.close = snd_tm6000_close,
.ioctl = snd_pcm_lib_ioctl,
diff --git a/drivers/media/usb/usbtv/usbtv-audio.c b/drivers/media/usb/usbtv/usbtv-audio.c
index 2c2ca77..14400f3 100644
--- a/drivers/media/usb/usbtv/usbtv-audio.c
+++ b/drivers/media/usb/usbtv/usbtv-audio.c
@@ -332,7 +332,7 @@ static snd_pcm_uframes_t snd_usbtv_pointer(struct snd_pcm_substream *substream)
return chip->snd_buffer_pos;
}
-static const struct snd_pcm_ops snd_usbtv_pcm_ops = {
+static struct snd_pcm_ops snd_usbtv_pcm_ops = {
.open = snd_usbtv_pcm_open,
.close = snd_usbtv_pcm_close,
.ioctl = snd_pcm_lib_ioctl,
diff --git a/sound/pci/bt87x.c b/sound/pci/bt87x.c
index eb3d306..bcc4ec4 100644
--- a/sound/pci/bt87x.c
+++ b/sound/pci/bt87x.c
@@ -550,7 +550,7 @@ static snd_pcm_uframes_t snd_bt87x_pointer(struct snd_pcm_substream *substream)
return (snd_pcm_uframes_t)bytes_to_frames(runtime, chip->current_line * chip->line_bytes);
}
-static const struct snd_pcm_ops snd_bt87x_pcm_ops = {
+static struct snd_pcm_ops snd_bt87x_pcm_ops = {
.open = snd_bt87x_pcm_open,
.close = snd_bt87x_close,
.ioctl = snd_pcm_lib_ioctl,

View File

@@ -1,73 +0,0 @@
--- a/drivers/media/firewire/firedtv-fw.c 2013-07-24 14:34:38.319443243 +0200
+++ b/drivers/media/firewire/firedtv-fw.c 2013-05-11 16:19:28.000000000 +0200
@@ -248,7 +248,7 @@
/* Adjust the template string if models with longer names appear. */
#define MAX_MODEL_NAME_LEN sizeof("FireDTV ????")
-static int node_probe(struct fw_unit *unit, const struct ieee1394_device_id *id)
+static int node_probe(struct device *dev)
{
struct firedtv *fdtv;
char name[MAX_MODEL_NAME_LEN];
@@ -258,8 +258,8 @@
if (!fdtv)
return -ENOMEM;
- dev_set_drvdata(&unit->device, fdtv);
- fdtv->device = &unit->device;
+ dev_set_drvdata(dev, fdtv);
+ fdtv->device = dev;
fdtv->isochannel = -1;
fdtv->voltage = 0xff;
fdtv->tone = 0xff;
@@ -269,7 +269,7 @@
mutex_init(&fdtv->demux_mutex);
INIT_WORK(&fdtv->remote_ctrl_work, avc_remote_ctrl_work);
- name_len = fw_csr_string(unit->directory, CSR_MODEL,
+ name_len = fw_csr_string(fw_unit(dev)->directory, CSR_MODEL,
name, sizeof(name));
for (i = ARRAY_SIZE(model_names); --i; )
if (strlen(model_names[i]) <= name_len &&
@@ -277,7 +277,7 @@
break;
fdtv->type = i;
- err = fdtv_register_rc(fdtv, &unit->device);
+ err = fdtv_register_rc(fdtv, dev);
if (err)
goto fail_free;
@@ -307,9 +307,9 @@
return err;
}
-static void node_remove(struct fw_unit *unit)
+static int node_remove(struct device *dev)
{
- struct firedtv *fdtv = dev_get_drvdata(&unit->device);
+ struct firedtv *fdtv = dev_get_drvdata(dev);
fdtv_dvb_unregister(fdtv);
@@ -320,6 +320,7 @@
fdtv_unregister_rc(fdtv);
kfree(fdtv);
+ return 0;
}
static void node_update(struct fw_unit *unit)
@@ -390,10 +391,10 @@
.owner = THIS_MODULE,
.name = "firedtv",
.bus = &fw_bus_type,
+ .probe = node_probe,
+ .remove = node_remove,
},
- .probe = node_probe,
.update = node_update,
- .remove = node_remove,
.id_table = fdtv_id_table,
};

View File

@@ -1,12 +0,0 @@
diff --git a/drivers/media/rc/ir-hix5hd2.c b/drivers/media/rc/ir-hix5hd2.c
index c555ca2..37cfb68 100644
--- a/drivers/media/rc/ir-hix5hd2.c
+++ b/drivers/media/rc/ir-hix5hd2.c
@@ -13,6 +13,7 @@
#include <linux/mfd/syscon.h>
#include <linux/module.h>
#include <linux/of_device.h>
+#include <linux/of.h>
#include <linux/regmap.h>
#include <media/rc-core.h>

View File

@@ -1,76 +0,0 @@
diff --git a/drivers/media/v4l2-core/v4l2-dev.c b/drivers/media/v4l2-core/v4l2-dev.c
index b5aaaac..b2f207f 100644
--- a/drivers/media/v4l2-core/v4l2-dev.c
+++ b/drivers/media/v4l2-core/v4l2-dev.c
@@ -38,25 +38,24 @@
* sysfs stuff
*/
-static ssize_t index_show(struct device *cd,
- struct device_attribute *attr, char *buf)
+static ssize_t show_index(struct device *cd,
+ struct device_attribute *attr, char *buf)
{
struct video_device *vdev = to_video_device(cd);
return sprintf(buf, "%i\n", vdev->index);
}
-static DEVICE_ATTR_RO(index);
-static ssize_t dev_debug_show(struct device *cd,
- struct device_attribute *attr, char *buf)
+static ssize_t show_dev_debug(struct device *cd,
+ struct device_attribute *attr, char *buf)
{
struct video_device *vdev = to_video_device(cd);
return sprintf(buf, "%i\n", vdev->dev_debug);
}
-static ssize_t dev_debug_store(struct device *cd, struct device_attribute *attr,
- const char *buf, size_t len)
+static ssize_t set_dev_debug(struct device *cd, struct device_attribute *attr,
+ const char *buf, size_t len)
{
struct video_device *vdev = to_video_device(cd);
int res = 0;
@@ -69,24 +68,21 @@ static ssize_t dev_debug_store(struct device *cd, struct device_attribute *attr,
vdev->dev_debug = value;
return len;
}
-static DEVICE_ATTR_RW(dev_debug);
-static ssize_t name_show(struct device *cd,
+static ssize_t show_name(struct device *cd,
struct device_attribute *attr, char *buf)
{
struct video_device *vdev = to_video_device(cd);
return sprintf(buf, "%.*s\n", (int)sizeof(vdev->name), vdev->name);
}
-static DEVICE_ATTR_RO(name);
-static struct attribute *video_device_attrs[] = {
- &dev_attr_name.attr,
- &dev_attr_dev_debug.attr,
- &dev_attr_index.attr,
- NULL,
+static struct device_attribute video_device_attrs[] = {
+ __ATTR(name, S_IRUGO, show_name, NULL),
+ __ATTR(dev_debug, 0644, show_dev_debug, set_dev_debug),
+ __ATTR(index, S_IRUGO, show_index, NULL),
+ __ATTR_NULL
};
-ATTRIBUTE_GROUPS(video_device);
/*
* Active devices
@@ -221,7 +217,7 @@ static void v4l2_device_release(struct device *cd)
static struct class video_class = {
.name = VIDEO_NAME,
- .dev_groups = video_device_groups,
+ .dev_attrs = video_device_attrs,
};
struct video_device *video_devdata(struct file *file)

View File

@@ -1,13 +0,0 @@
diff --git a/drivers/media/test-drivers/vidtv/vidtv_bridge.c b/drivers/media/test-drivers/vidtv/vidtv_bridge.c
index 74b054947bbe..8b67d883c651 100644
--- a/drivers/media/test-drivers/vidtv/vidtv_bridge.c
+++ b/drivers/media/test-drivers/vidtv/vidtv_bridge.c
@@ -196,7 +196,7 @@ static int vidtv_stop_streaming(struct vidtv_dvb *dvb)
vidtv_mux_destroy(dvb->mux);
dvb->mux = NULL;
- dev_dbg_ratelimited(dev, "Stopped streaming\n");
+ dev_dbg(dev, "Stopped streaming\n");
return 0;
}

View File

@@ -1,51 +0,0 @@
diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c
index 2f9e0c1..dc1a534 100644
--- a/drivers/media/rc/lirc_dev.c
+++ b/drivers/media/rc/lirc_dev.c
@@ -92,9 +92,11 @@ void ir_lirc_raw_event(struct rc_dev *dev, struct ir_raw_event ev)
LIRC_VALUE_MASK);
spin_lock_irqsave(&dev->lirc_fh_lock, flags);
- list_for_each_entry(fh, &dev->lirc_fh, list)
- kfifo_put(&fh->rawir,
- LIRC_SPACE(dev->gap_duration));
+ list_for_each_entry(fh, &dev->lirc_fh, list) {
+ unsigned int gap_duration = LIRC_SPACE(dev->gap_duration);
+ kfifo_in(&fh->rawir, &gap_duration, sizeof(gap_duration));
+ }
+
spin_unlock_irqrestore(&dev->lirc_fh_lock, flags);
dev->gap = false;
}
@@ -109,7 +111,8 @@ void ir_lirc_raw_event(struct rc_dev *dev, struct ir_raw_event ev)
list_for_each_entry(fh, &dev->lirc_fh, list) {
if (LIRC_IS_TIMEOUT(sample) && !fh->send_timeout_reports)
continue;
- if (kfifo_put(&fh->rawir, sample))
+
+ if (kfifo_in(&fh->rawir, &sample, sizeof(sample)))
wake_up_poll(&fh->wait_poll, EPOLLIN | EPOLLRDNORM);
}
spin_unlock_irqrestore(&dev->lirc_fh_lock, flags);
@@ -130,7 +133,7 @@ void ir_lirc_scancode_event(struct rc_dev *dev, struct lirc_scancode *lsc)
spin_lock_irqsave(&dev->lirc_fh_lock, flags);
list_for_each_entry(fh, &dev->lirc_fh, list) {
- if (kfifo_put(&fh->scancodes, *lsc))
+ if (kfifo_in(&fh->scancodes, lsc, sizeof(*lsc)))
wake_up_poll(&fh->wait_poll, EPOLLIN | EPOLLRDNORM);
}
spin_unlock_irqrestore(&dev->lirc_fh_lock, flags);
diff --git a/drivers/media/rc/rc-ir-raw.c b/drivers/media/rc/rc-ir-raw.c
index 213394b..7fe73f0 100644
--- a/drivers/media/rc/rc-ir-raw.c
+++ b/drivers/media/rc/rc-ir-raw.c
@@ -69,7 +69,7 @@ int ir_raw_event_store(struct rc_dev *dev, struct ir_raw_event *ev)
dev_dbg(&dev->dev, "sample: (%05dus %s)\n",
TO_US(ev->duration), TO_STR(ev->pulse));
- if (!kfifo_put(&dev->raw->kfifo, *ev)) {
+ if (kfifo_in(&dev->raw->kfifo, ev, sizeof(*ev)) != sizeof(*ev)) {
dev_err(&dev->dev, "IR event FIFO is full!\n");
return -ENOSPC;
}

View File

@@ -1,30 +0,0 @@
diff --git a/drivers/media/pci/ddbridge/ddbridge-main.c b/drivers/media/pci/ddbridge/ddbridge-main.c
index 9ab4736..50c3b4f 100644
--- a/drivers/media/pci/ddbridge/ddbridge-main.c
+++ b/drivers/media/pci/ddbridge/ddbridge-main.c
@@ -129,14 +129,18 @@ static void ddb_irq_msi(struct ddb *dev, int nr)
int stat;
if (msi && pci_msi_enabled()) {
- stat = pci_enable_msi_range(dev->pdev, 1, nr);
- if (stat >= 1) {
- dev->msi = stat;
- dev_info(dev->dev, "using %d MSI interrupt(s)\n",
- dev->msi);
- } else {
- dev_info(dev->dev, "MSI not available.\n");
+ stat = pci_enable_msi_block(dev->pdev, nr);
+ if (stat == 0) {
+ dev->msi = nr;
+ } else if (stat == 1) {
+ stat = pci_enable_msi(dev->pdev);
+ dev->msi = 1;
}
+ if (stat < 0)
+ dev_info(dev->dev, "MSI not available.\n");
+ else
+ dev_info(dev->dev, "using %d MSI interrupts\n",
+ dev->msi);
}
}
#endif

View File

@@ -1,39 +0,0 @@
diff --git a/drivers/media/common/videobuf2/videobuf2-dma-contig.c b/drivers/media/common/videobuf2/videobuf2-dma-contig.c
index 8712cf6fab88..1128aea4db3c 100644
--- a/drivers/media/common/videobuf2/videobuf2-dma-contig.c
+++ b/drivers/media/common/videobuf2/videobuf2-dma-contig.c
@@ -425,7 +425,7 @@ static struct dma_buf *vb2_dc_get_dmabuf(void *buf_priv, unsigned long flags)
if (WARN_ON(!buf->sgt_base))
return NULL;
- dbuf = dma_buf_export(buf, &vb2_dc_dmabuf_ops, buf->size, flags, NULL);
+ dbuf = dma_buf_export(buf, &vb2_dc_dmabuf_ops, buf->size, flags);
if (IS_ERR(dbuf))
return NULL;
diff --git a/drivers/media/common/videobuf2/videobuf2-dma-sg.c b/drivers/media/common/videobuf2/videobuf2-dma-sg.c
index 8960099c53e0..473e514ac5a2 100644
--- a/drivers/media/common/videobuf2/videobuf2-dma-sg.c
+++ b/drivers/media/common/videobuf2/videobuf2-dma-sg.c
@@ -551,7 +551,7 @@ static struct dma_buf *vb2_dma_sg_get_dmabuf(void *buf_priv, unsigned long flags
if (WARN_ON(!buf->dma_sgt))
return NULL;
- dbuf = dma_buf_export(buf, &vb2_dma_sg_dmabuf_ops, buf->size, flags, NULL);
+ dbuf = dma_buf_export(buf, &vb2_dma_sg_dmabuf_ops, buf->size, flags);
if (IS_ERR(dbuf))
return NULL;
diff --git a/drivers/media/common/videobuf2/videobuf2-vmalloc.c b/drivers/media/common/videobuf2/videobuf2-vmalloc.c
index d47476dd8a40..fceedbe3f7cf 100644
--- a/drivers/media/common/videobuf2/videobuf2-vmalloc.c
+++ b/drivers/media/common/videobuf2/videobuf2-vmalloc.c
@@ -358,7 +358,7 @@ static struct dma_buf *vb2_vmalloc_get_dmabuf(void *buf_priv, unsigned long flag
if (WARN_ON(!buf->vaddr))
return NULL;
- dbuf = dma_buf_export(buf, &vb2_vmalloc_dmabuf_ops, buf->size, flags, NULL);
+ dbuf = dma_buf_export(buf, &vb2_vmalloc_dmabuf_ops, buf->size, flags);
if (IS_ERR(dbuf))
return NULL;

View File

@@ -1,12 +0,0 @@
diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c
index 7741151606ef..13da4c5c7d17 100644
--- a/drivers/media/rc/rc-main.c
+++ b/drivers/media/rc/rc-main.c
@@ -1773,7 +1773,6 @@ static int rc_prepare_rx_device(struct rc_dev *dev)
set_bit(MSC_SCAN, dev->input_dev->mscbit);
/* Pointer/mouse events */
- set_bit(INPUT_PROP_POINTING_STICK, dev->input_dev->propbit);
set_bit(EV_REL, dev->input_dev->evbit);
set_bit(REL_X, dev->input_dev->relbit);
set_bit(REL_Y, dev->input_dev->relbit);

View File

@@ -1,13 +0,0 @@
diff --git a/drivers/media/dvb-core/dvb_net.c b/drivers/media/dvb-core/dvb_net.c
index 059e611..5e7052e 100644
--- a/drivers/media/dvb-core/dvb_net.c
+++ b/drivers/media/dvb-core/dvb_net.c
@@ -1277,7 +1277,7 @@ static int dvb_net_add_if(struct dvb_net *dvbnet, u16 pid, u8 feedtype)
return -EINVAL;
net = alloc_netdev(sizeof(struct dvb_net_priv), "dvb",
- NET_NAME_UNKNOWN, dvb_net_setup);
+ dvb_net_setup);
if (!net)
return -ENOMEM;

View File

@@ -1,17 +0,0 @@
diff --git a/drivers/media/dvb-frontends/cxd2820r_core.c b/drivers/media/dvb-frontends/cxd2820r_core.c
index 95267c6..6583f29 100644
--- a/drivers/media/dvb-frontends/cxd2820r_core.c
+++ b/drivers/media/dvb-frontends/cxd2820r_core.c
@@ -726,8 +726,10 @@ static int cxd2820r_remove(struct i2c_client *client)
dev_dbg(&client->dev, "\n");
#ifdef CONFIG_GPIOLIB
- if (priv->gpio_chip.label)
- gpiochip_remove(&priv->gpio_chip);
+ if (priv->gpio_chip.label) {
+ int ret = gpiochip_remove(&priv->gpio_chip);
+ (void)ret;
+ }
#endif
regmap_exit(priv->regmap[1]);
i2c_unregister_device(priv->client[1]);

View File

@@ -1,36 +0,0 @@
diff --git a/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c b/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c
index 2e90310..c13e604f 100644
--- a/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c
+++ b/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c
@@ -253,6 +253,13 @@ static int dvb_usbv2_adapter_stream_exit(struct dvb_usb_adapter *adap)
return usb_urb_exitv2(&adap->stream);
}
+static int wait_schedule(void *ptr)
+{
+ schedule();
+
+ return 0;
+}
+
static int dvb_usb_start_feed(struct dvb_demux_feed *dvbdmxfeed)
{
struct dvb_usb_adapter *adap = dvbdmxfeed->demux->priv;
@@ -266,7 +273,7 @@ static int dvb_usb_start_feed(struct dvb_demux_feed *dvbdmxfeed)
dvbdmxfeed->pid, dvbdmxfeed->index);
/* wait init is done */
- wait_on_bit(&adap->state_bits, ADAP_INIT, TASK_UNINTERRUPTIBLE);
+ wait_on_bit(&adap->state_bits, ADAP_INIT, wait_schedule, TASK_UNINTERRUPTIBLE);
if (adap->active_fe == -1)
return -EINVAL;
@@ -561,7 +568,7 @@ static int dvb_usb_fe_sleep(struct dvb_frontend *fe)
if (!adap->suspend_resume_active) {
set_bit(ADAP_SLEEP, &adap->state_bits);
wait_on_bit(&adap->state_bits, ADAP_STREAMING,
- TASK_UNINTERRUPTIBLE);
+ wait_schedule, TASK_UNINTERRUPTIBLE);
}
if (adap->fe_sleep[fe->id]) {

View File

@@ -1,35 +0,0 @@
diff --git a/drivers/media/pci/saa7164/saa7164-encoder.c b/drivers/media/pci/saa7164/saa7164-encoder.c
index 1b184c3..3537c6f 100644
--- a/drivers/media/pci/saa7164/saa7164-encoder.c
+++ b/drivers/media/pci/saa7164/saa7164-encoder.c
@@ -389,7 +389,7 @@ int saa7164_s_frequency(struct saa7164_port *port,
if (f->tuner != 0)
return -EINVAL;
- port->freq = clamp(f->frequency,
+ port->freq = clamp_t(u32, f->frequency,
SAA7164_TV_MIN_FREQ, SAA7164_TV_MAX_FREQ);
/* Update the hardware */
diff --git a/drivers/media/usb/hackrf/hackrf.c b/drivers/media/usb/hackrf/hackrf.c
index e05bfec..b132ecb 100644
--- a/drivers/media/usb/hackrf/hackrf.c
+++ b/drivers/media/usb/hackrf/hackrf.c
@@ -1108,7 +1108,7 @@ static int hackrf_s_frequency(struct file *file, void *priv,
f->tuner, f->type, f->frequency);
if (f->tuner == 0) {
- uitmp = clamp(f->frequency, bands_adc_dac[0].rangelow,
+ uitmp = clamp_t(u32, f->frequency, bands_adc_dac[0].rangelow,
bands_adc_dac[0].rangehigh);
if (vdev->vfl_dir == VFL_DIR_RX) {
dev->f_adc = uitmp;
@@ -1118,7 +1118,7 @@ static int hackrf_s_frequency(struct file *file, void *priv,
set_bit(TX_DAC_FREQUENCY, &dev->flags);
}
} else if (f->tuner == 1) {
- uitmp = clamp(f->frequency, bands_rx_tx[0].rangelow,
+ uitmp = clamp_t(u32, f->frequency, bands_rx_tx[0].rangelow,
bands_rx_tx[0].rangehigh);
if (vdev->vfl_dir == VFL_DIR_RX) {
dev->f_rx = uitmp;

View File

@@ -1,44 +0,0 @@
diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c
index f862f1b..79f35b7 100644
--- a/drivers/media/rc/lirc_dev.c
+++ b/drivers/media/rc/lirc_dev.c
@@ -848,27 +848,4 @@ void __exit lirc_dev_exit(void)
unregister_chrdev_region(lirc_base_dev, RC_DEV_MAX);
}
-struct rc_dev *rc_dev_get_from_fd(int fd)
-{
- struct fd f = fdget(fd);
- struct lirc_fh *fh;
- struct rc_dev *dev;
-
- if (!f.file)
- return ERR_PTR(-EBADF);
-
- if (f.file->f_op != &lirc_fops) {
- fdput(f);
- return ERR_PTR(-EINVAL);
- }
-
- fh = f.file->private_data;
- dev = fh->rc;
-
- get_device(&dev->dev);
- fdput(f);
-
- return dev;
-}
-
MODULE_ALIAS("lirc_dev");
diff --git a/drivers/media/rc/rc-core-priv.h b/drivers/media/rc/rc-core-priv.h
index e847bda..389b528 100644
--- a/drivers/media/rc/rc-core-priv.h
+++ b/drivers/media/rc/rc-core-priv.h
@@ -13,7 +13,6 @@
#define MAX_IR_EVENT_SIZE 512
#include <linux/slab.h>
-#include <uapi/linux/bpf.h>
#include <media/rc-core.h>
/**

View File

@@ -1,12 +0,0 @@
diff --git a/drivers/media/mc/mc-entity.c b/drivers/media/mc/mc-entity.c
index a998a2e0ea1d..9fa66a2dee00 100644
--- a/drivers/media/mc/mc-entity.c
+++ b/drivers/media/mc/mc-entity.c
@@ -17,7 +17,6 @@
*/
#include <linux/bitmap.h>
-#include <linux/property.h>
#include <linux/slab.h>
#include <media/media-entity.h>
#include <media/media-device.h>

View File

@@ -1,26 +0,0 @@
diff --git a/drivers/media/test-drivers/vivid/vivid-rds-gen.c b/drivers/media/test-drivers/vivid/vivid-rds-gen.c
index 996e35e..53c7777 100644
--- a/drivers/media/test-drivers/vivid/vivid-rds-gen.c
+++ b/drivers/media/test-drivers/vivid/vivid-rds-gen.c
@@ -103,7 +103,7 @@ void vivid_rds_generate(struct vivid_rds_gen *rds)
* EN 50067:1998 to convert a UTC date to an RDS Modified
* Julian Day.
*/
- time64_to_tm(ktime_get_real_seconds(), 0, &tm);
+ time_to_tm(get_seconds(), 0, &tm);
l = tm.tm_mon <= 1;
date = 14956 + tm.tm_mday + ((tm.tm_year - l) * 1461) / 4 +
((tm.tm_mon + 2 + l * 12) * 306001) / 10000;
diff --git a/drivers/media/test-drivers/vivid/vivid-vbi-gen.c b/drivers/media/test-drivers/vivid/vivid-vbi-gen.c
index 02c79d7..a2159de 100644
--- a/drivers/media/test-drivers/vivid/vivid-vbi-gen.c
+++ b/drivers/media/test-drivers/vivid/vivid-vbi-gen.c
@@ -190,7 +190,7 @@ static void vivid_vbi_gen_set_time_of_day(u8 *packet)
struct tm tm;
u8 checksum, i;
- time64_to_tm(ktime_get_real_seconds(), 0, &tm);
+ time_to_tm(get_seconds(), 0, &tm);
packet[0] = calc_parity(0x07);
packet[1] = calc_parity(0x01);
packet[2] = calc_parity(0x40 | tm.tm_min);

View File

@@ -1,15 +0,0 @@
diff --git a/mm/frame_vector.c b/mm/frame_vector.c
index 7cf2b71..1199a59 100644
--- a/mm/frame_vector.c
+++ b/mm/frame_vector.c
@@ -58,8 +58,8 @@ int get_vaddr_frames(unsigned long start, unsigned int nr_frames,
if (!(vma->vm_flags & (VM_IO | VM_PFNMAP))) {
vec->got_ref = true;
vec->is_pfns = false;
- ret = get_user_pages_locked(current, mm, start, nr_frames,
- write, force, (struct page **)(vec->ptrs), &locked);
+ ret = get_user_pages(current, mm, start, nr_frames,
+ write, force, (struct page **)(vec->ptrs), NULL);
goto out;
}

View File

@@ -1,43 +0,0 @@
diff --git a/drivers/media/pci/ivtv/ivtv-udma.c b/drivers/media/pci/ivtv/ivtv-udma.c
index 02f8652..8c21ab3 100644
--- a/drivers/media/pci/ivtv/ivtv-udma.c
+++ b/drivers/media/pci/ivtv/ivtv-udma.c
@@ -124,8 +124,10 @@ int ivtv_udma_setup(struct ivtv *itv, unsigned long ivtv_dest_addr,
}
/* Get user pages for DMA Xfer */
- err = get_user_pages_unlocked(current, current->mm,
- user_dma.uaddr, user_dma.page_count, 0, 1, dma->map);
+ down_read(&current->mm->mmap_sem);
+ err = get_user_pages(current, current->mm,
+ user_dma.uaddr, user_dma.page_count, 0, 1, dma->map, NULL);
+ up_read(&current->mm->mmap_sem);
if (user_dma.page_count != err) {
IVTV_DEBUG_WARN("failed to map user pages, returned %d instead of %d\n",
diff --git a/drivers/media/pci/ivtv/ivtv-yuv.c b/drivers/media/pci/ivtv/ivtv-yuv.c
index 4e4b3b4..eacca1c 100644
--- a/drivers/media/pci/ivtv/ivtv-yuv.c
+++ b/drivers/media/pci/ivtv/ivtv-yuv.c
@@ -75,15 +75,15 @@ static int ivtv_yuv_prep_user_dma(struct ivtv *itv, struct ivtv_user_dma *dma,
ivtv_udma_get_page_info (&uv_dma, (unsigned long)args->uv_source, 360 * uv_decode_height);
/* Get user pages for DMA Xfer */
- y_pages = get_user_pages_unlocked(current, current->mm,
- y_dma.uaddr, y_dma.page_count, 0, 1,
- &dma->map[0]);
+ down_read(&current->mm->mmap_sem);
+ y_pages = get_user_pages(current, current->mm, y_dma.uaddr, y_dma.page_count, 0, 1, &dma->map[0], NULL);
uv_pages = 0; /* silence gcc. value is set and consumed only if: */
if (y_pages == y_dma.page_count) {
- uv_pages = get_user_pages_unlocked(current, current->mm,
- uv_dma.uaddr, uv_dma.page_count, 0, 1,
- &dma->map[y_pages]);
+ uv_pages = get_user_pages(current, current->mm,
+ uv_dma.uaddr, uv_dma.page_count, 0, 1,
+ &dma->map[y_pages], NULL);
}
+ up_read(&current->mm->mmap_sem);
if (y_pages != y_dma.page_count || uv_pages != uv_dma.page_count) {
int rc = -EFAULT;

View File

@@ -1,72 +0,0 @@
diff --git a/drivers/media/common/videobuf2/videobuf2-dma-contig.c b/drivers/media/common/videobuf2/videobuf2-dma-contig.c
index 620c4aa..4b62c9c 100644
--- a/drivers/media/common/videobuf2/videobuf2-dma-contig.c
+++ b/drivers/media/common/videobuf2/videobuf2-dma-contig.c
@@ -402,12 +402,6 @@ static struct dma_buf *vb2_dc_get_dmabuf(void *buf_priv, unsigned long flags)
{
struct vb2_dc_buf *buf = buf_priv;
struct dma_buf *dbuf;
- DEFINE_DMA_BUF_EXPORT_INFO(exp_info);
-
- exp_info.ops = &vb2_dc_dmabuf_ops;
- exp_info.size = buf->size;
- exp_info.flags = flags;
- exp_info.priv = buf;
if (!buf->sgt_base)
buf->sgt_base = vb2_dc_get_base_sgt(buf);
@@ -415,7 +409,7 @@ static struct dma_buf *vb2_dc_get_dmabuf(void *buf_priv, unsigned long flags)
if (WARN_ON(!buf->sgt_base))
return NULL;
- dbuf = dma_buf_export(&exp_info);
+ dbuf = dma_buf_export(buf, &vb2_dc_dmabuf_ops, buf->size, flags, NULL);
if (IS_ERR(dbuf))
return NULL;
diff --git a/drivers/media/common/videobuf2/videobuf2-dma-sg.c b/drivers/media/common/videobuf2/videobuf2-dma-sg.c
index afd4b51..71510e4 100644
--- a/drivers/media/common/videobuf2/videobuf2-dma-sg.c
+++ b/drivers/media/common/videobuf2/videobuf2-dma-sg.c
@@ -589,17 +589,11 @@ static struct dma_buf *vb2_dma_sg_get_dmabuf(void *buf_priv, unsigned long flags
{
struct vb2_dma_sg_buf *buf = buf_priv;
struct dma_buf *dbuf;
- DEFINE_DMA_BUF_EXPORT_INFO(exp_info);
-
- exp_info.ops = &vb2_dma_sg_dmabuf_ops;
- exp_info.size = buf->size;
- exp_info.flags = flags;
- exp_info.priv = buf;
if (WARN_ON(!buf->dma_sgt))
return NULL;
- dbuf = dma_buf_export(&exp_info);
+ dbuf = dma_buf_export(buf, &vb2_dma_sg_dmabuf_ops, buf->size, flags, NULL);
if (IS_ERR(dbuf))
return NULL;
diff --git a/drivers/media/common/videobuf2/videobuf2-vmalloc.c b/drivers/media/common/videobuf2/videobuf2-vmalloc.c
index 0ba40be..c060cf9 100644
--- a/drivers/media/common/videobuf2/videobuf2-vmalloc.c
+++ b/drivers/media/common/videobuf2/videobuf2-vmalloc.c
@@ -372,17 +372,11 @@ static struct dma_buf *vb2_vmalloc_get_dmabuf(void *buf_priv, unsigned long flag
{
struct vb2_vmalloc_buf *buf = buf_priv;
struct dma_buf *dbuf;
- DEFINE_DMA_BUF_EXPORT_INFO(exp_info);
-
- exp_info.ops = &vb2_vmalloc_dmabuf_ops;
- exp_info.size = buf->size;
- exp_info.flags = flags;
- exp_info.priv = buf;
if (WARN_ON(!buf->vaddr))
return NULL;
- dbuf = dma_buf_export(&exp_info);
+ dbuf = dma_buf_export(buf, &vb2_vmalloc_dmabuf_ops, buf->size, flags, NULL);
if (IS_ERR(dbuf))
return NULL;

View File

@@ -1,85 +0,0 @@
diff --git a/drivers/media/common/videobuf2/videobuf2-core.c b/drivers/media/common/videobuf2/videobuf2-core.c
index 4489744fbbd9..b10977cdcfa0 100644
--- a/drivers/media/common/videobuf2/videobuf2-core.c
+++ b/drivers/media/common/videobuf2/videobuf2-core.c
@@ -29,8 +29,6 @@
#include <media/videobuf2-core.h>
#include <media/v4l2-mc.h>
-#include <trace/events/vb2.h>
-
static int debug;
module_param(debug, int, 0644);
@@ -966,7 +964,6 @@ void vb2_buffer_done(struct vb2_buffer *vb, enum vb2_buffer_state state)
spin_unlock_irqrestore(&q->done_lock, flags);
- trace_vb2_buf_done(q, vb);
switch (state) {
case VB2_BUF_STATE_QUEUED:
@@ -1263,7 +1260,6 @@ static void __enqueue_in_driver(struct vb2_buffer *vb)
vb->state = VB2_BUF_STATE_ACTIVE;
atomic_inc(&q->owned_by_drv_count);
- trace_vb2_buf_queue(q, vb);
call_void_vb_qop(vb, buf_queue, vb);
}
@@ -1619,7 +1615,6 @@ int vb2_core_qbuf(struct vb2_queue *q, unsigned int index, void *pb,
if (pb)
call_void_bufop(q, copy_timestamp, vb, pb);
- trace_vb2_qbuf(q, vb);
/*
* If already streaming, give the buffer to driver for processing.
@@ -1835,7 +1830,6 @@ int vb2_core_dqbuf(struct vb2_queue *q, unsigned int *pindex, void *pb,
list_del(&vb->queued_entry);
q->queued_count--;
- trace_vb2_dqbuf(q, vb);
/* go back to dequeued state */
__vb2_dqbuf(vb);
diff --git a/drivers/media/v4l2-core/Makefile b/drivers/media/v4l2-core/Makefile
index d4c35b9c7d75..7003ea9db688 100644
--- a/drivers/media/v4l2-core/Makefile
+++ b/drivers/media/v4l2-core/Makefile
@@ -9,7 +9,7 @@ videodev-objs := v4l2-dev.o v4l2-ioctl.o v4l2-device.o v4l2-fh.o \
v4l2-event.o v4l2-ctrls.o v4l2-subdev.o v4l2-clk.o \
v4l2-async.o
videodev-$(CONFIG_COMPAT) += v4l2-compat-ioctl32.o
-videodev-$(CONFIG_TRACEPOINTS) += v4l2-trace.o
+#videodev-$(CONFIG_TRACEPOINTS) += v4l2-trace.o
videodev-$(CONFIG_MEDIA_CONTROLLER) += v4l2-mc.o
#obj-$(CONFIG_V4L2_FWNODE) += v4l2-fwnode.o
diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
index 9484cc2619e4..d7522e1831b0 100644
--- a/drivers/media/v4l2-core/v4l2-ioctl.c
+++ b/drivers/media/v4l2-core/v4l2-ioctl.c
@@ -27,8 +27,6 @@
#include <media/v4l2-mc.h>
#include <media/v4l2-mem2mem.h>
-#include <trace/events/v4l2.h>
-
/* Zero out the end of the struct pointed to by p. Everything after, but
* not including, the specified field is cleared. */
#define CLEAR_AFTER_FIELD(p, field) \
@@ -3095,13 +3093,6 @@ video_usercopy(struct file *file, unsigned int cmd, unsigned long arg,
goto out;
}
- if (err == 0) {
- if (cmd == VIDIOC_DQBUF)
- trace_v4l2_dqbuf(video_devdata(file)->minor, parg);
- else if (cmd == VIDIOC_QBUF)
- trace_v4l2_qbuf(video_devdata(file)->minor, parg);
- }
-
if (has_array_args) {
*kernel_ptr = (void __force *)user_ptr;
if (copy_to_user(user_ptr, mbuf, array_size))

View File

@@ -1,26 +0,0 @@
diff --git a/drivers/media/v4l2-core/v4l2-i2c.c b/drivers/media/v4l2-core/v4l2-i2c.c
index 5bf99e7c0c09..241c079ae28e 100644
--- a/drivers/media/v4l2-core/v4l2-i2c.c
+++ b/drivers/media/v4l2-core/v4l2-i2c.c
@@ -24,7 +24,7 @@ void v4l2_i2c_subdev_unregister(struct v4l2_subdev *sd)
* registered by us, and would not be
* re-created by just probing the V4L2 driver.
*/
- if (client && !client->dev.of_node && !client->dev.fwnode)
+ if (client && !client->dev.of_node)
i2c_unregister_device(client);
}
diff --git a/drivers/media/v4l2-core/v4l2-spi.c b/drivers/media/v4l2-core/v4l2-spi.c
index eadecdff7349..65ac92a23fb3 100644
--- a/drivers/media/v4l2-core/v4l2-spi.c
+++ b/drivers/media/v4l2-core/v4l2-spi.c
@@ -12,7 +12,7 @@ void v4l2_spi_subdev_unregister(struct v4l2_subdev *sd)
{
struct spi_device *spi = v4l2_get_subdevdata(sd);
- if (spi && !spi->dev.of_node && !spi->dev.fwnode)
+ if (spi && !spi->dev.of_node)
spi_unregister_device(spi);
}

86
backports/v4.11_pwc.patch Normal file
View File

@@ -0,0 +1,86 @@
diff --git a/drivers/media/usb/pwc/pwc-if.c b/drivers/media/usb/pwc/pwc-if.c
index 5e3339cc31c0..61869636ec61 100644
--- a/drivers/media/usb/pwc/pwc-if.c
+++ b/drivers/media/usb/pwc/pwc-if.c
@@ -155,17 +155,16 @@ static const struct video_device pwc_template = {
/***************************************************************************/
/* Private functions */
-static void *pwc_alloc_urb_buffer(struct usb_device *dev,
+static void *pwc_alloc_urb_buffer(struct device *dev,
size_t size, dma_addr_t *dma_handle)
{
- struct device *dmadev = dev->bus->sysdev;
void *buffer = kmalloc(size, GFP_KERNEL);
if (!buffer)
return NULL;
- *dma_handle = dma_map_single(dmadev, buffer, size, DMA_FROM_DEVICE);
- if (dma_mapping_error(dmadev, *dma_handle)) {
+ *dma_handle = dma_map_single(dev, buffer, size, DMA_FROM_DEVICE);
+ if (dma_mapping_error(dev, *dma_handle)) {
kfree(buffer);
return NULL;
}
@@ -173,14 +172,12 @@ static void *pwc_alloc_urb_buffer(struct usb_device *dev,
return buffer;
}
-static void pwc_free_urb_buffer(struct usb_device *dev,
+static void pwc_free_urb_buffer(struct device *dev,
size_t size,
void *buffer,
dma_addr_t dma_handle)
{
- struct device *dmadev = dev->bus->sysdev;
-
- dma_unmap_single(dmadev, dma_handle, size, DMA_FROM_DEVICE);
+ dma_unmap_single(dev, dma_handle, size, DMA_FROM_DEVICE);
kfree(buffer);
}
@@ -285,7 +282,6 @@ static void pwc_frame_complete(struct pwc_device *pdev)
static void pwc_isoc_handler(struct urb *urb)
{
struct pwc_device *pdev = (struct pwc_device *)urb->context;
- struct device *dmadev = urb->dev->bus->sysdev;
int i, fst, flen;
unsigned char *iso_buf = NULL;
@@ -332,7 +328,7 @@ static void pwc_isoc_handler(struct urb *urb)
/* Reset ISOC error counter. We did get here, after all. */
pdev->visoc_errors = 0;
- dma_sync_single_for_cpu(dmadev,
+ dma_sync_single_for_cpu(&urb->dev->dev,
urb->transfer_dma,
urb->transfer_buffer_length,
DMA_FROM_DEVICE);
@@ -383,7 +379,7 @@ static void pwc_isoc_handler(struct urb *urb)
pdev->vlast_packet_size = flen;
}
- dma_sync_single_for_device(dmadev,
+ dma_sync_single_for_device(&urb->dev->dev,
urb->transfer_dma,
urb->transfer_buffer_length,
DMA_FROM_DEVICE);
@@ -465,7 +461,7 @@ static int pwc_isoc_init(struct pwc_device *pdev)
urb->pipe = usb_rcvisocpipe(udev, pdev->vendpoint);
urb->transfer_flags = URB_ISO_ASAP | URB_NO_TRANSFER_DMA_MAP;
urb->transfer_buffer_length = ISO_BUFFER_SIZE;
- urb->transfer_buffer = pwc_alloc_urb_buffer(udev,
+ urb->transfer_buffer = pwc_alloc_urb_buffer(&udev->dev,
urb->transfer_buffer_length,
&urb->transfer_dma);
if (urb->transfer_buffer == NULL) {
@@ -528,7 +524,7 @@ static void pwc_iso_free(struct pwc_device *pdev)
if (urb) {
PWC_DEBUG_MEMORY("Freeing URB\n");
if (urb->transfer_buffer)
- pwc_free_urb_buffer(urb->dev,
+ pwc_free_urb_buffer(&urb->dev->dev,
urb->transfer_buffer_length,
urb->transfer_buffer,
urb->transfer_dma);

View File

@@ -0,0 +1,25 @@
diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async.c
index 64643b169783..27469c10fc06 100644
--- a/drivers/media/v4l2-core/v4l2-async.c
+++ b/drivers/media/v4l2-core/v4l2-async.c
@@ -837,6 +837,7 @@ void v4l2_async_unregister_subdev(struct v4l2_subdev *sd)
}
EXPORT_SYMBOL(v4l2_async_unregister_subdev);
+#if 0
static void print_waiting_subdev(struct seq_file *s,
struct v4l2_async_subdev *asd)
{
@@ -894,9 +895,12 @@ static int pending_subdevs_show(struct seq_file *s, void *data)
return 0;
}
DEFINE_SHOW_ATTRIBUTE(pending_subdevs);
+#endif
void v4l2_async_debug_init(struct dentry *debugfs_dir)
{
+#if 0
debugfs_create_file("pending_async_subdevices", 0444, debugfs_dir, NULL,
&pending_subdevs_fops);
+#endif
}

View File

@@ -1,37 +0,0 @@
diff --git a/drivers/media/v4l2-core/Makefile b/drivers/media/v4l2-core/Makefile
index 4d42418e603e..d4c35b9c7d75 100644
--- a/drivers/media/v4l2-core/Makefile
+++ b/drivers/media/v4l2-core/Makefile
@@ -12,7 +12,7 @@ videodev-$(CONFIG_COMPAT) += v4l2-compat-ioctl32.o
videodev-$(CONFIG_TRACEPOINTS) += v4l2-trace.o
videodev-$(CONFIG_MEDIA_CONTROLLER) += v4l2-mc.o
-obj-$(CONFIG_V4L2_FWNODE) += v4l2-fwnode.o
+#obj-$(CONFIG_V4L2_FWNODE) += v4l2-fwnode.o
obj-$(CONFIG_VIDEO_V4L2) += videodev.o
obj-$(CONFIG_VIDEO_V4L2) += v4l2-common.o
obj-$(CONFIG_VIDEO_V4L2) += v4l2-dv-timings.o
diff --git a/include/media/media-entity.h b/include/media/media-entity.h
index 8cb2c504a05c..3de214237d1c 100644
--- a/include/media/media-entity.h
+++ b/include/media/media-entity.h
@@ -13,7 +13,6 @@
#include <linux/bitmap.h>
#include <linux/bug.h>
-#include <linux/fwnode.h>
#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/media.h>
diff --git a/include/media/v4l2-fwnode.h b/include/media/v4l2-fwnode.h
index f6a7bcd13197..b28eeef45959 100644
--- a/include/media/v4l2-fwnode.h
+++ b/include/media/v4l2-fwnode.h
@@ -15,7 +15,6 @@
#define _V4L2_FWNODE_H
#include <linux/errno.h>
-#include <linux/fwnode.h>
#include <linux/list.h>
#include <linux/types.h>

View File

@@ -1,13 +0,0 @@
diff --git a/drivers/media/pci/ivtv/ivtvfb.c b/drivers/media/pci/ivtv/ivtvfb.c
index cfd21040d0e3..a0d61a9e4459 100644
--- a/drivers/media/pci/ivtv/ivtvfb.c
+++ b/drivers/media/pci/ivtv/ivtvfb.c
@@ -1171,7 +1171,7 @@ static int ivtvfb_init_card(struct ivtv *itv)
int rc;
#ifdef CONFIG_X86_64
- if (pat_enabled()) {
+ if (pat_enabled) {
if (ivtvfb_force_pat) {
pr_info("PAT is enabled. Write-combined framebuffer caching will be disabled.\n");
pr_info("To enable caching, boot with nopat kernel parameter\n");

View File

@@ -1,49 +0,0 @@
diff --git a/drivers/media/rc/rc-ir-raw.c b/drivers/media/rc/rc-ir-raw.c
index 2ab8a2b..c76da2e 100644
--- a/drivers/media/rc/rc-ir-raw.c
+++ b/drivers/media/rc/rc-ir-raw.c
@@ -16,7 +16,8 @@ static LIST_HEAD(ir_raw_client_list);
/* Used to handle IR raw handler extensions */
static DEFINE_MUTEX(ir_raw_handler_lock);
static LIST_HEAD(ir_raw_handler_list);
-static atomic64_t available_protocols = ATOMIC64_INIT(0);
+static DEFINE_MUTEX(available_protocols_lock);
+static u64 available_protocols;
static int ir_raw_event_thread(void *data)
{
@@ -228,7 +229,11 @@ EXPORT_SYMBOL_GPL(ir_raw_event_handle);
u64
ir_raw_get_allowed_protocols(void)
{
- return atomic64_read(&available_protocols);
+ u64 protocols;
+ mutex_lock(&available_protocols_lock);
+ protocols = available_protocols;
+ mutex_unlock(&available_protocols_lock);
+ return protocols;
}
static int change_protocol(struct rc_dev *dev, u64 *rc_proto)
@@ -673,7 +678,9 @@ int ir_raw_handler_register(struct ir_raw_handler *ir_raw_handler)
{
mutex_lock(&ir_raw_handler_lock);
list_add_tail(&ir_raw_handler->list, &ir_raw_handler_list);
- atomic64_or(ir_raw_handler->protocols, &available_protocols);
+ mutex_lock(&available_protocols_lock);
+ available_protocols |= ir_raw_handler->protocols;
+ mutex_unlock(&available_protocols_lock);
mutex_unlock(&ir_raw_handler_lock);
return 0;
@@ -693,7 +700,9 @@ void ir_raw_handler_unregister(struct ir_raw_handler *ir_raw_handler)
ir_raw_handler->raw_unregister(raw->dev);
ir_raw_disable_protocols(raw->dev, protocols);
}
- atomic64_andnot(protocols, &available_protocols);
+ mutex_lock(&available_protocols_lock);
+ available_protocols &= ~protocols;
+ mutex_unlock(&available_protocols_lock);
mutex_unlock(&ir_raw_handler_lock);
}
EXPORT_SYMBOL(ir_raw_handler_unregister);

View File

@@ -1,250 +0,0 @@
From fe6a2319288c1f4a66b4ffa6c8e9bf4b39349d11 Mon Sep 17 00:00:00 2001
From: Hans Verkuil <hans.verkuil@cisco.com>
Date: Mon, 21 Nov 2016 10:21:30 +0100
Subject: [PATCH] Add frame_vector.c
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
---
mm/frame_vector.c | 230 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 230 insertions(+)
create mode 100644 mm/frame_vec.c
diff --git a/mm/frame_vector.c b/mm/frame_vector.c
new file mode 100644
index 0000000..cdabcb9
--- /dev/null
+++ b/mm/frame_vector.c
@@ -0,0 +1,230 @@
+#include <linux/kernel.h>
+#include <linux/errno.h>
+#include <linux/err.h>
+#include <linux/mm.h>
+#include <linux/slab.h>
+#include <linux/vmalloc.h>
+#include <linux/pagemap.h>
+#include <linux/sched.h>
+
+/*
+ * get_vaddr_frames() - map virtual addresses to pfns
+ * @start: starting user address
+ * @nr_frames: number of pages / pfns from start to map
+ * @write: whether pages will be written to by the caller
+ * @force: whether to force write access even if user mapping is
+ * readonly. See description of the same argument of
+ get_user_pages().
+ * @vec: structure which receives pages / pfns of the addresses mapped.
+ * It should have space for at least nr_frames entries.
+ *
+ * This function maps virtual addresses from @start and fills @vec structure
+ * with page frame numbers or page pointers to corresponding pages (choice
+ * depends on the type of the vma underlying the virtual address). If @start
+ * belongs to a normal vma, the function grabs reference to each of the pages
+ * to pin them in memory. If @start belongs to VM_IO | VM_PFNMAP vma, we don't
+ * touch page structures and the caller must make sure pfns aren't reused for
+ * anything else while he is using them.
+ *
+ * The function returns number of pages mapped which may be less than
+ * @nr_frames. In particular we stop mapping if there are more vmas of
+ * different type underlying the specified range of virtual addresses.
+ * When the function isn't able to map a single page, it returns error.
+ *
+ * This function takes care of grabbing mmap_sem as necessary.
+ */
+int get_vaddr_frames(unsigned long start, unsigned int nr_frames,
+ bool write, bool force, struct frame_vector *vec)
+{
+ struct mm_struct *mm = current->mm;
+ struct vm_area_struct *vma;
+ int ret = 0;
+ int err;
+ int locked;
+
+ if (nr_frames == 0)
+ return 0;
+
+ if (WARN_ON_ONCE(nr_frames > vec->nr_allocated))
+ nr_frames = vec->nr_allocated;
+
+ down_read(&mm->mmap_sem);
+ locked = 1;
+ vma = find_vma_intersection(mm, start, start + 1);
+ if (!vma) {
+ ret = -EFAULT;
+ goto out;
+ }
+ if (!(vma->vm_flags & (VM_IO | VM_PFNMAP))) {
+ vec->got_ref = true;
+ vec->is_pfns = false;
+ ret = get_user_pages_locked(current, mm, start, nr_frames,
+ write, force, (struct page **)(vec->ptrs), &locked);
+ goto out;
+ }
+
+ vec->got_ref = false;
+ vec->is_pfns = true;
+ do {
+ unsigned long *nums = frame_vector_pfns(vec);
+
+ while (ret < nr_frames && start + PAGE_SIZE <= vma->vm_end) {
+ err = follow_pfn(vma, start, &nums[ret]);
+ if (err) {
+ if (ret == 0)
+ ret = err;
+ goto out;
+ }
+ start += PAGE_SIZE;
+ ret++;
+ }
+ /*
+ * We stop if we have enough pages or if VMA doesn't completely
+ * cover the tail page.
+ */
+ if (ret >= nr_frames || start < vma->vm_end)
+ break;
+ vma = find_vma_intersection(mm, start, start + 1);
+ } while (vma && vma->vm_flags & (VM_IO | VM_PFNMAP));
+out:
+ if (locked)
+ up_read(&mm->mmap_sem);
+ if (!ret)
+ ret = -EFAULT;
+ if (ret > 0)
+ vec->nr_frames = ret;
+ return ret;
+}
+EXPORT_SYMBOL(get_vaddr_frames);
+
+/**
+ * put_vaddr_frames() - drop references to pages if get_vaddr_frames() acquired
+ * them
+ * @vec: frame vector to put
+ *
+ * Drop references to pages if get_vaddr_frames() acquired them. We also
+ * invalidate the frame vector so that it is prepared for the next call into
+ * get_vaddr_frames().
+ */
+void put_vaddr_frames(struct frame_vector *vec)
+{
+ int i;
+ struct page **pages;
+
+ if (!vec->got_ref)
+ goto out;
+ pages = frame_vector_pages(vec);
+ /*
+ * frame_vector_pages() might needed to do a conversion when
+ * get_vaddr_frames() got pages but vec was later converted to pfns.
+ * But it shouldn't really fail to convert pfns back...
+ */
+ if (WARN_ON(IS_ERR(pages)))
+ goto out;
+ for (i = 0; i < vec->nr_frames; i++)
+ put_page(pages[i]);
+ vec->got_ref = false;
+out:
+ vec->nr_frames = 0;
+}
+EXPORT_SYMBOL(put_vaddr_frames);
+
+/**
+ * frame_vector_to_pages - convert frame vector to contain page pointers
+ * @vec: frame vector to convert
+ *
+ * Convert @vec to contain array of page pointers. If the conversion is
+ * successful, return 0. Otherwise return an error. Note that we do not grab
+ * page references for the page structures.
+ */
+int frame_vector_to_pages(struct frame_vector *vec)
+{
+ int i;
+ unsigned long *nums;
+ struct page **pages;
+
+ if (!vec->is_pfns)
+ return 0;
+ nums = frame_vector_pfns(vec);
+ for (i = 0; i < vec->nr_frames; i++)
+ if (!pfn_valid(nums[i]))
+ return -EINVAL;
+ pages = (struct page **)nums;
+ for (i = 0; i < vec->nr_frames; i++)
+ pages[i] = pfn_to_page(nums[i]);
+ vec->is_pfns = false;
+ return 0;
+}
+EXPORT_SYMBOL(frame_vector_to_pages);
+
+/**
+ * frame_vector_to_pfns - convert frame vector to contain pfns
+ * @vec: frame vector to convert
+ *
+ * Convert @vec to contain array of pfns.
+ */
+void frame_vector_to_pfns(struct frame_vector *vec)
+{
+ int i;
+ unsigned long *nums;
+ struct page **pages;
+
+ if (vec->is_pfns)
+ return;
+ pages = (struct page **)(vec->ptrs);
+ nums = (unsigned long *)pages;
+ for (i = 0; i < vec->nr_frames; i++)
+ nums[i] = page_to_pfn(pages[i]);
+ vec->is_pfns = true;
+}
+EXPORT_SYMBOL(frame_vector_to_pfns);
+
+/**
+ * frame_vector_create() - allocate & initialize structure for pinned pfns
+ * @nr_frames: number of pfns slots we should reserve
+ *
+ * Allocate and initialize struct pinned_pfns to be able to hold @nr_pfns
+ * pfns.
+ */
+struct frame_vector *frame_vector_create(unsigned int nr_frames)
+{
+ struct frame_vector *vec;
+ int size = sizeof(struct frame_vector) + sizeof(void *) * nr_frames;
+
+ if (WARN_ON_ONCE(nr_frames == 0))
+ return NULL;
+ /*
+ * This is absurdly high. It's here just to avoid strange effects when
+ * arithmetics overflows.
+ */
+ if (WARN_ON_ONCE(nr_frames > INT_MAX / sizeof(void *) / 2))
+ return NULL;
+ /*
+ * Avoid higher order allocations, use vmalloc instead. It should
+ * be rare anyway.
+ */
+ if (size <= PAGE_SIZE)
+ vec = kmalloc(size, GFP_KERNEL);
+ else
+ vec = vmalloc(size);
+ if (!vec)
+ return NULL;
+ vec->nr_allocated = nr_frames;
+ vec->nr_frames = 0;
+ return vec;
+}
+EXPORT_SYMBOL(frame_vector_create);
+
+/**
+ * frame_vector_destroy() - free memory allocated to carry frame vector
+ * @vec: Frame vector to free
+ *
+ * Free structure allocated by frame_vector_create() to carry frames.
+ */
+void frame_vector_destroy(struct frame_vector *vec)
+{
+ /* Make sure put_vaddr_frames() got called properly... */
+ VM_BUG_ON(vec->nr_frames > 0);
+ kvfree(vec);
+}
+EXPORT_SYMBOL(frame_vector_destroy);
--
2.10.1

24
backports/v5.0_gpio.patch Normal file
View File

@@ -0,0 +1,24 @@
diff --git a/drivers/media/i2c/ov5648.c b/drivers/media/i2c/ov5648.c
index 609aa67b54ce..e8eaca154dac 100644
--- a/drivers/media/i2c/ov5648.c
+++ b/drivers/media/i2c/ov5648.c
@@ -12,6 +12,7 @@
#include <linux/of_graph.h>
#include <linux/pm_runtime.h>
#include <linux/regulator/consumer.h>
+#include <linux/gpio/consumer.h>
#include <linux/videodev2.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-device.h>
diff --git a/drivers/media/i2c/ov8865.c b/drivers/media/i2c/ov8865.c
index fda5a55979aa..5fcdbd03a74f 100644
--- a/drivers/media/i2c/ov8865.c
+++ b/drivers/media/i2c/ov8865.c
@@ -13,6 +13,7 @@
#include <linux/of_graph.h>
#include <linux/pm_runtime.h>
#include <linux/regulator/consumer.h>
+#include <linux/gpio/consumer.h>
#include <linux/videodev2.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-device.h>

View File

@@ -1,7 +1,7 @@
diff --git a/drivers/media/pci/intel/ipu3/ipu3-cio2.c b/drivers/media/pci/intel/ipu3/ipu3-cio2.c
diff --git a/drivers/media/pci/intel/ipu3/ipu3-cio2-main.c b/drivers/media/pci/intel/ipu3/ipu3-cio2-main.c
index 4e598e937dfe..035cd2449d24 100644
--- a/drivers/media/pci/intel/ipu3/ipu3-cio2.c
+++ b/drivers/media/pci/intel/ipu3/ipu3-cio2.c
--- a/drivers/media/pci/intel/ipu3/ipu3-cio2-main.c
+++ b/drivers/media/pci/intel/ipu3/ipu3-cio2-main.c
@@ -836,7 +836,7 @@ static int cio2_vb2_buf_init(struct vb2_buffer *vb)
unsigned int pages = PFN_UP(vb->planes[0].length);
unsigned int lops = DIV_ROUND_UP(pages + 1, CIO2_LOP_ENTRIES);

View File

@@ -0,0 +1,13 @@
diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async.c
index 64643b169783..0b44b0d1e7b4 100644
--- a/drivers/media/v4l2-core/v4l2-async.c
+++ b/drivers/media/v4l2-core/v4l2-async.c
@@ -856,7 +856,7 @@ static void print_waiting_subdev(struct seq_file *s,
fwnode_handle_get(fwnode);
seq_printf(s, " [fwnode] dev=%s, node=%pfw\n",
- devnode->dev ? dev_name(devnode->dev) : "nil",
+ "nil",
fwnode);
fwnode_handle_put(devnode);

View File

@@ -48,6 +48,7 @@ TARFILES += include/uapi/linux/v4l2-dv-timings.h
TARFILES += include/uapi/linux/v4l2-controls.h
TARFILES += include/uapi/linux/uvcvideo.h
TARFILES += include/uapi/linux/xilinx-v4l2-controls.h
TARFILES += include/uapi/linux/ccs.h
TARFILES += include/uapi/linux/smiapp.h
TARFILES += include/uapi/linux/v4l2-subdev.h
TARFILES += include/uapi/linux/v4l2-common.h

View File

@@ -67,6 +67,8 @@ VIDEO_OV5670
VIDEO_OV9734
VIDEO_OV5675
VIDEO_OV8856
VIDEO_OV8865
VIDEO_OV5648
VIDEO_OV7251
VIDEO_IMX258
VIDEO_DW9807
@@ -109,106 +111,3 @@ DVB_AF9013
VIDEO_OV13858
# needs gpiochip_get_data
VIDEO_SOLO6X10
[4.3.0]
# needs regmap_write_bits
DVB_CXD2820R
MEDIA_TUNER_TDA18250
# needs struct reg_sequence
VIDEO_OV7740
[4.2.0]
# needs clkdev_create
VIDEO_CAFE_CCIC
[4.1.0]
# needs has_acpi_companion
CEC_SECO
[4.2.0]
# needs led_trigger_remove
V4L2_FLASH_LED_CLASS
[3.19.0]
# needs of_property_read_u64_array
VIDEO_MT9V032
# needs debugfs_create_devm_seqfile
CEC_CORE
MEDIA_CEC_SUPPORT
# needs fwnode_property_read_u32
SDR_MAX2175
# needs fwnode_property_present
VIDEO_OV7670
VIDEO_OV5640
[3.18.0]
# needs LED brightness support
V4L2_FLASH_LED_CLASS
# includes property.h
VIDEO_MT9M111
[3.17.0]
# needs GPIOD_OUT_LOW/HIGH
VIDEO_ADV7604
VIDEO_MT9P031
SOC_CAMERA_OV2640
I2C_SI4713
VIDEO_TC358743
VIDEO_ADP1653
VIDEO_TVP5150
VIDEO_ADV7180
VIDEO_ET8EK8
VIDEO_OV2640
VIDEO_OV5645
IR_GPIO_TX
IR_GPIO_CIR
VIDEO_OV5695
VIDEO_OV9640
VIDEO_OV2685
VIDEO_OV2659
VIDEO_TW9910
VIDEO_MT9T112
VIDEO_MT9M001
VIDEO_RJ54N1
SOC_CAMERA_RJ54N1
RADIO_SI470X
VIDEO_AD5820
# needs component_match_add
VIDEO_VIMC
# needs bpf.h
BPF_LIRC_MODE2
# needs ktime_to_timespec64
DVB_VIDTV
[3.15.0]
# needs reset_control_get_optional
RC_ST
[3.14.0]
# needs pci_enable_msi_range
VIDEO_COBALT
# requires m2m_ctx in struct v4l2_fh
VIDEO_VIM2M
VIDEO_VICODEC
# requires devm_phy_optional_get
VIDEO_CADENCE_CSI2RX
[3.13.0]
# needs gpio/consumer.h
RADIO_SI4713
[3.12.0]
# BIN_ATTR_RW was changed
IR_NUVOTON
# needs devm_regulator_get_optional
CXD2880_SPI_DRV
[3.11.0]
# needs freezable_schedule_hrtimeout_range
DVB_PT3
# needs arch_phys_wc_add
VIDEO_FB_IVTV
[3.10.0]
# needs include/linux/mfd/syscon.h
IR_HIX5HD2