Commit 7f2b8af2 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Merge tag 'intel_th-stm-for-greg-20190221' of...

Merge tag 'intel_th-stm-for-greg-20190221' of git://git.kernel.org/pub/scm/linux/kernel/git/ash/stm into char-misc-next

Alexander writes:

stm class/intel_th: Updates for v5.1

These are:
  * 2 bugfixes in stm class
  * one bugfix in intel_th
  * a few minor cleanups

* tag 'intel_th-stm-for-greg-20190221' of git://git.kernel.org/pub/scm/linux/kernel/git/ash/stm:
  stm class: Prevent division by zero
  stm class: Fix an endless loop in channel allocation
  intel_th: Don't reference unassigned outputs
  intel_th: pti: Use sysfs_match_string() helper
  intel_th: Only create useful device nodes
  intel_th: Mark expected switch fall-throughs
  intel_th: Update ABI documentation
parents 37fd0b62 bf7cbaae
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -3,11 +3,13 @@ Date: June 2015
KernelVersion:	4.3
Contact:	Alexander Shishkin <alexander.shishkin@linux.intel.com>
Description:	(RW) Writes of 1 or 0 enable or disable trace output to this
		output device. Reads return current status.
		output device. Reads return current status. Requires that the
		correstponding output port driver be loaded.

What:		/sys/bus/intel_th/devices/<intel_th_id>-msc<msc-id>/port
Date:		June 2015
KernelVersion:	4.3
Contact:	Alexander Shishkin <alexander.shishkin@linux.intel.com>
Description:	(RO) Port number, corresponding to this output device on the
		switch (GTH).
		switch (GTH) or "unassigned" if the corresponding output
		port driver is not loaded.
+5 −1
Original line number Diff line number Diff line
@@ -422,6 +422,7 @@ static const struct intel_th_subdevice {
	unsigned		nres;
	unsigned		type;
	unsigned		otype;
	bool			mknode;
	unsigned		scrpd;
	int			id;
} intel_th_subdevices[] = {
@@ -456,6 +457,7 @@ static const struct intel_th_subdevice {
		.name	= "msc",
		.id	= 0,
		.type	= INTEL_TH_OUTPUT,
		.mknode	= true,
		.otype	= GTH_MSU,
		.scrpd	= SCRPD_MEM_IS_PRIM_DEST | SCRPD_MSC0_IS_ENABLED,
	},
@@ -476,6 +478,7 @@ static const struct intel_th_subdevice {
		.name	= "msc",
		.id	= 1,
		.type	= INTEL_TH_OUTPUT,
		.mknode	= true,
		.otype	= GTH_MSU,
		.scrpd	= SCRPD_MEM_IS_PRIM_DEST | SCRPD_MSC1_IS_ENABLED,
	},
@@ -635,6 +638,7 @@ intel_th_subdevice_alloc(struct intel_th *th,
	}

	if (subdev->type == INTEL_TH_OUTPUT) {
		if (subdev->mknode)
			thdev->dev.devt = MKDEV(th->major, th->num_thdevs);
		thdev->output.type = subdev->otype;
		thdev->output.port = -1;
+4 −0
Original line number Diff line number Diff line
@@ -607,6 +607,7 @@ static void intel_th_gth_unassign(struct intel_th_device *thdev,
{
	struct gth_device *gth = dev_get_drvdata(&thdev->dev);
	int port = othdev->output.port;
	int master;

	if (thdev->host_mode)
		return;
@@ -615,6 +616,9 @@ static void intel_th_gth_unassign(struct intel_th_device *thdev,
	othdev->output.port = -1;
	othdev->output.active = false;
	gth->output[port].output = NULL;
	for (master = 0; master < TH_CONFIGURABLE_MASTERS; master++)
		if (gth->master[master] == port)
			gth->master[master] = -1;
	spin_unlock(&gth->gth_lock);
}

+7 −9
Original line number Diff line number Diff line
@@ -272,19 +272,17 @@ static ssize_t lpp_dest_store(struct device *dev, struct device_attribute *attr,
			      const char *buf, size_t size)
{
	struct pti_device *pti = dev_get_drvdata(dev);
	ssize_t ret = -EINVAL;
	int i;

	for (i = 0; i < ARRAY_SIZE(lpp_dest_str); i++)
		if (sysfs_streq(buf, lpp_dest_str[i]))
			break;
	i = sysfs_match_string(lpp_dest_str, buf);
	if (i < 0)
		return i;

	if (i < ARRAY_SIZE(lpp_dest_str) && pti->lpp_dest_mask & BIT(i)) {
		pti->lpp_dest = i;
		ret = size;
	}
	if (!(pti->lpp_dest_mask & BIT(i)))
		return -EINVAL;

	return ret;
	pti->lpp_dest = i;
	return size;
}

static DEVICE_ATTR_RW(lpp_dest);
+4 −0
Original line number Diff line number Diff line
@@ -84,8 +84,12 @@ static ssize_t notrace sth_stm_packet(struct stm_data *stm_data,
	/* Global packets (GERR, XSYNC, TRIG) are sent with register writes */
	case STP_PACKET_GERR:
		reg += 4;
		/* fall through */

	case STP_PACKET_XSYNC:
		reg += 8;
		/* fall through */

	case STP_PACKET_TRIG:
		if (flags & STP_PACKET_TIMESTAMPED)
			reg += 4;
Loading