Merge tag 'char-misc-5.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Pull char/misc driver updates from Greg KH: "Here is the big char/misc driver patch pull request for 5.1-rc1. The largest thing by far is the new habanalabs driver for their AI accelerator chip. For now it is in the drivers/misc directory but will probably move to a new directory soon along with other drivers of this type. Other than that, just the usual set of individual driver updates and fixes. There's an "odd" merge in here from the DRM tree that they asked me to do as the MEI driver is starting to interact with the i915 driver, and it needed some coordination. All of those patches have been properly acked by the relevant subsystem maintainers. All of these have been in linux-next with no reported issues, most for quite some time" * tag 'char-misc-5.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (219 commits) habanalabs: adjust Kconfig to fix build errors habanalabs: use %px instead of %p in error print habanalabs: use do_div for 64-bit divisions intel_th: gth: Fix an off-by-one in output unassigning habanalabs: fix little-endian<->cpu conversion warnings habanalabs: use NULL to initialize array of pointers habanalabs: fix little-endian<->cpu conversion warnings habanalabs: soft-reset device if context-switch fails habanalabs: print pointer using %p habanalabs: fix memory leak with CBs with unaligned size habanalabs: return correct error code on MMU mapping failure habanalabs: add comments in uapi/misc/habanalabs.h habanalabs: extend QMAN0 job timeout habanalabs: set DMA0 completion to SOB 1007 habanalabs: fix validation of WREG32 to DMA completion habanalabs: fix mmu cache registers init habanalabs: disable CPU access on timeouts habanalabs: add MMU DRAM default page mapping habanalabs: Dissociate RAZWI info from event types misc/habanalabs: adjust Kconfig to fix build errors ...
This commit is contained in:
@@ -668,6 +668,10 @@ static const struct amba_id debug_ids[] = {
|
||||
.id = 0x000bbd08,
|
||||
.mask = 0x000fffff,
|
||||
},
|
||||
{ /* Debug for Cortex-A73 */
|
||||
.id = 0x000bbd09,
|
||||
.mask = 0x000fffff,
|
||||
},
|
||||
{ 0, 0 },
|
||||
};
|
||||
|
||||
|
@@ -55,7 +55,8 @@ static void etm4_os_unlock(struct etmv4_drvdata *drvdata)
|
||||
|
||||
static bool etm4_arch_supported(u8 arch)
|
||||
{
|
||||
switch (arch) {
|
||||
/* Mask out the minor version number */
|
||||
switch (arch & 0xf0) {
|
||||
case ETM_ARCH_V4:
|
||||
break;
|
||||
default:
|
||||
|
@@ -793,7 +793,7 @@ static int stm_probe(struct amba_device *adev, const struct amba_id *id)
|
||||
struct stm_drvdata *drvdata;
|
||||
struct resource *res = &adev->res;
|
||||
struct resource ch_res;
|
||||
size_t res_size, bitmap_size;
|
||||
size_t bitmap_size;
|
||||
struct coresight_desc desc = { 0 };
|
||||
struct device_node *np = adev->dev.of_node;
|
||||
|
||||
@@ -833,15 +833,11 @@ static int stm_probe(struct amba_device *adev, const struct amba_id *id)
|
||||
|
||||
drvdata->write_bytes = stm_fundamental_data_size(drvdata);
|
||||
|
||||
if (boot_nr_channel) {
|
||||
if (boot_nr_channel)
|
||||
drvdata->numsp = boot_nr_channel;
|
||||
res_size = min((resource_size_t)(boot_nr_channel *
|
||||
BYTES_PER_CHANNEL), resource_size(res));
|
||||
} else {
|
||||
else
|
||||
drvdata->numsp = stm_num_stimulus_port(drvdata);
|
||||
res_size = min((resource_size_t)(drvdata->numsp *
|
||||
BYTES_PER_CHANNEL), resource_size(res));
|
||||
}
|
||||
|
||||
bitmap_size = BITS_TO_LONGS(drvdata->numsp) * sizeof(long);
|
||||
|
||||
guaranteed = devm_kzalloc(dev, bitmap_size, GFP_KERNEL);
|
||||
|
@@ -80,8 +80,8 @@ static struct device_node *of_coresight_get_port_parent(struct device_node *ep)
|
||||
* Skip one-level up to the real device node, if we
|
||||
* are using the new bindings.
|
||||
*/
|
||||
if (!of_node_cmp(parent->name, "in-ports") ||
|
||||
!of_node_cmp(parent->name, "out-ports"))
|
||||
if (of_node_name_eq(parent, "in-ports") ||
|
||||
of_node_name_eq(parent, "out-ports"))
|
||||
parent = of_get_next_parent(parent);
|
||||
|
||||
return parent;
|
||||
|
@@ -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,7 +638,8 @@ intel_th_subdevice_alloc(struct intel_th *th,
|
||||
}
|
||||
|
||||
if (subdev->type == INTEL_TH_OUTPUT) {
|
||||
thdev->dev.devt = MKDEV(th->major, th->num_thdevs);
|
||||
if (subdev->mknode)
|
||||
thdev->dev.devt = MKDEV(th->major, th->num_thdevs);
|
||||
thdev->output.type = subdev->otype;
|
||||
thdev->output.port = -1;
|
||||
thdev->output.scratchpad = subdev->scrpd;
|
||||
|
@@ -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(>h->gth_lock);
|
||||
}
|
||||
|
||||
|
@@ -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);
|
||||
|
@@ -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;
|
||||
|
@@ -244,6 +244,9 @@ static int find_free_channels(unsigned long *bitmap, unsigned int start,
|
||||
;
|
||||
if (i == width)
|
||||
return pos;
|
||||
|
||||
/* step over [pos..pos+i) to continue search */
|
||||
pos += i;
|
||||
}
|
||||
|
||||
return -1;
|
||||
@@ -732,7 +735,7 @@ static int stm_char_policy_set_ioctl(struct stm_file *stmf, void __user *arg)
|
||||
struct stm_device *stm = stmf->stm;
|
||||
struct stp_policy_id *id;
|
||||
char *ids[] = { NULL, NULL };
|
||||
int ret = -EINVAL;
|
||||
int ret = -EINVAL, wlimit = 1;
|
||||
u32 size;
|
||||
|
||||
if (stmf->output.nr_chans)
|
||||
@@ -760,8 +763,10 @@ static int stm_char_policy_set_ioctl(struct stm_file *stmf, void __user *arg)
|
||||
if (id->__reserved_0 || id->__reserved_1)
|
||||
goto err_free;
|
||||
|
||||
if (id->width < 1 ||
|
||||
id->width > PAGE_SIZE / stm->data->sw_mmiosz)
|
||||
if (stm->data->sw_mmiosz)
|
||||
wlimit = PAGE_SIZE / stm->data->sw_mmiosz;
|
||||
|
||||
if (id->width < 1 || id->width > wlimit)
|
||||
goto err_free;
|
||||
|
||||
ids[0] = id->id;
|
||||
|
Reference in New Issue
Block a user