Commit 6398b9fc authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull char/misc driver fixes from Greg KH:
 "Here are some small char and other driver fixes for 5.5-rc3.

  The most noticable one is a much-reported fix for a random driver
  issue that came up from 5.5-rc1 compat_ioctl cleanups. The others are
  a chunk of habanalab driver fixes and intel_th driver fixes and new
  device ids.

  All have been in linux-next with no reported issues"

* tag 'char-misc-5.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
  random: don't forget compat_ioctl on urandom
  intel_th: msu: Fix window switching without windows
  intel_th: Fix freeing IRQs
  intel_th: pci: Add Elkhart Lake SOC support
  intel_th: pci: Add Comet Lake PCH-V support
  habanalabs: remove variable 'val' set but not used
  habanalabs: rate limit error msg on waiting for CS
parents 107aff96 4aa37c46
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2175,6 +2175,7 @@ const struct file_operations urandom_fops = {
	.read  = urandom_read,
	.write = random_write,
	.unlocked_ioctl = random_ioctl,
	.compat_ioctl = compat_ptr_ioctl,
	.fasync = random_fasync,
	.llseek = noop_llseek,
};
+4 −3
Original line number Diff line number Diff line
@@ -834,9 +834,6 @@ static irqreturn_t intel_th_irq(int irq, void *data)
			ret |= d->irq(th->thdev[i]);
	}

	if (ret == IRQ_NONE)
		pr_warn_ratelimited("nobody cared for irq\n");

	return ret;
}

@@ -887,6 +884,7 @@ intel_th_alloc(struct device *dev, struct intel_th_drvdata *drvdata,

			if (th->irq == -1)
				th->irq = devres[r].start;
			th->num_irqs++;
			break;
		default:
			dev_warn(dev, "Unknown resource type %lx\n",
@@ -940,6 +938,9 @@ void intel_th_free(struct intel_th *th)

	th->num_thdevs = 0;

	for (i = 0; i < th->num_irqs; i++)
		devm_free_irq(th->dev, th->irq + i, th);

	pm_runtime_get_sync(th->dev);
	pm_runtime_forbid(th->dev);

+2 −0
Original line number Diff line number Diff line
@@ -261,6 +261,7 @@ enum th_mmio_idx {
 * @num_thdevs:	number of devices in the @thdev array
 * @num_resources:	number of resources in the @resource array
 * @irq:	irq number
 * @num_irqs:	number of IRQs is use
 * @id:		this Intel TH controller's device ID in the system
 * @major:	device node major for output devices
 */
@@ -277,6 +278,7 @@ struct intel_th {
	unsigned int		num_thdevs;
	unsigned int		num_resources;
	int			irq;
	int			num_irqs;

	int			id;
	int			major;
+9 −5
Original line number Diff line number Diff line
@@ -1676,10 +1676,13 @@ static int intel_th_msc_init(struct msc *msc)
	return 0;
}

static void msc_win_switch(struct msc *msc)
static int msc_win_switch(struct msc *msc)
{
	struct msc_window *first;

	if (list_empty(&msc->win_list))
		return -EINVAL;

	first = list_first_entry(&msc->win_list, struct msc_window, entry);

	if (msc_is_last_win(msc->cur_win))
@@ -1691,6 +1694,8 @@ static void msc_win_switch(struct msc *msc)
	msc->base_addr = msc_win_base_dma(msc->cur_win);

	intel_th_trace_switch(msc->thdev);

	return 0;
}

/**
@@ -2025,16 +2030,15 @@ win_switch_store(struct device *dev, struct device_attribute *attr,
	if (val != 1)
		return -EINVAL;

	ret = -EINVAL;
	mutex_lock(&msc->buf_mutex);
	/*
	 * Window switch can only happen in the "multi" mode.
	 * If a external buffer is engaged, they have the full
	 * control over window switching.
	 */
	if (msc->mode != MSC_MODE_MULTI || msc->mbuf)
		ret = -ENOTSUPP;
	else
		msc_win_switch(msc);
	if (msc->mode == MSC_MODE_MULTI && !msc->mbuf)
		ret = msc_win_switch(msc);
	mutex_unlock(&msc->buf_mutex);

	return ret ? ret : size;
+10 −0
Original line number Diff line number Diff line
@@ -204,6 +204,11 @@ static const struct pci_device_id intel_th_pci_id_table[] = {
		PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x06a6),
		.driver_data = (kernel_ulong_t)&intel_th_2x,
	},
	{
		/* Comet Lake PCH-V */
		PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0xa3a6),
		.driver_data = (kernel_ulong_t)&intel_th_2x,
	},
	{
		/* Ice Lake NNPI */
		PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x45c5),
@@ -229,6 +234,11 @@ static const struct pci_device_id intel_th_pci_id_table[] = {
		PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x4da6),
		.driver_data = (kernel_ulong_t)&intel_th_2x,
	},
	{
		/* Elkhart Lake */
		PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x4b26),
		.driver_data = (kernel_ulong_t)&intel_th_2x,
	},
	{ 0 },
};

Loading