/*
 * USB of helper code
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 */

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/usb/of.h>
#include <linux/usb/otg.h>

static const char *const usbphy_modes[] = {
	[USBPHY_INTERFACE_MODE_UNKNOWN]	= "",
	[USBPHY_INTERFACE_MODE_UTMI]	= "utmi",
	[USBPHY_INTERFACE_MODE_UTMIW]	= "utmi_wide",
	[USBPHY_INTERFACE_MODE_ULPI]	= "ulpi",
	[USBPHY_INTERFACE_MODE_SERIAL]	= "serial",
	[USBPHY_INTERFACE_MODE_HSIC]	= "hsic",
};

/**
 * of_usb_get_phy_mode - Get phy mode for given device_node
 * @np:	Pointer to the given device_node
 *
 * The function gets phy interface string from property 'phy_type',
 * and returns the corresponding enum usb_phy_interface
 */
enum usb_phy_interface of_usb_get_phy_mode(struct device_node *np)
{
	const char *phy_type;
	int err, i;

	err = of_property_read_string(np, "phy_type", &phy_type);
	if (err < 0)
		return USBPHY_INTERFACE_MODE_UNKNOWN;

	for (i = 0; i < ARRAY_SIZE(usbphy_modes); i++)
		if (!strcmp(phy_type, usbphy_modes[i]))
			return i;

	return USBPHY_INTERFACE_MODE_UNKNOWN;
}
EXPORT_SYMBOL_GPL(of_usb_get_phy_mode);
back'>packet-rx-pump-back</option>
</select> <input type='submit' value='switch'/></form></td></tr>
<tr><td class='sub'>net-next plumbings</td><td class='sub right'>Tobias Klauser</td></tr></table>
<table class='tabs'><tr><td>
<a href='/cgit.cgi/linux/net-next.git/'>summary</a><a href='/cgit.cgi/linux/net-next.git/refs/?id=d7df2443cd5f67fc6ee7c05a88e4996e8177f91b'>refs</a><a href='/cgit.cgi/linux/net-next.git/log/sound/soc/intel/haswell/sst-haswell-ipc.h'>log</a><a href='/cgit.cgi/linux/net-next.git/tree/sound/soc/intel/haswell/sst-haswell-ipc.h?id=d7df2443cd5f67fc6ee7c05a88e4996e8177f91b'>tree</a><a class='active' href='/cgit.cgi/linux/net-next.git/commit/sound/soc/intel/haswell/sst-haswell-ipc.h?id=d7df2443cd5f67fc6ee7c05a88e4996e8177f91b'>commit</a><a href='/cgit.cgi/linux/net-next.git/diff/sound/soc/intel/haswell/sst-haswell-ipc.h?id=d7df2443cd5f67fc6ee7c05a88e4996e8177f91b'>diff</a></td><td class='form'><form class='right' method='get' action='/cgit.cgi/linux/net-next.git/log/sound/soc/intel/haswell/sst-haswell-ipc.h'>
<input type='hidden' name='id' value='d7df2443cd5f67fc6ee7c05a88e4996e8177f91b'/><select name='qt'>
<option value='grep'>log msg</option>
<option value='author'>author</option>
<option value='committer'>committer</option>
<option value='range'>range</option>
</select>
<input class='txt' type='search' size='10' name='q' value=''/>
<input type='submit' value='search'/>
</form>
</td></tr></table>
<div class='path'>path: <a href='/cgit.cgi/linux/net-next.git/commit/?id=d7df2443cd5f67fc6ee7c05a88e4996e8177f91b'>root</a>/<a href='/cgit.cgi/linux/net-next.git/commit/sound?id=d7df2443cd5f67fc6ee7c05a88e4996e8177f91b'>sound</a>/<a href='/cgit.cgi/linux/net-next.git/commit/sound/soc?id=d7df2443cd5f67fc6ee7c05a88e4996e8177f91b'>soc</a>/<a href='/cgit.cgi/linux/net-next.git/commit/sound/soc/intel?id=d7df2443cd5f67fc6ee7c05a88e4996e8177f91b'>intel</a>/<a href='/cgit.cgi/linux/net-next.git/commit/sound/soc/intel/haswell?id=d7df2443cd5f67fc6ee7c05a88e4996e8177f91b'>haswell</a>/<a href='/cgit.cgi/linux/net-next.git/commit/sound/soc/intel/haswell/sst-haswell-ipc.h?id=d7df2443cd5f67fc6ee7c05a88e4996e8177f91b'>sst-haswell-ipc.h</a></div><div class='content'><div class='cgit-panel'><b>diff options</b><form method='get'><input type='hidden' name='id' value='d7df2443cd5f67fc6ee7c05a88e4996e8177f91b'/><table><tr><td colspan='2'/></tr><tr><td class='label'>context:</td><td class='ctrl'><select name='context' onchange='this.form.submit();'><option value='1'>1</option><option value='2'>2</option><option value='3' selected='selected'>3</option><option value='4'>4</option><option value='5'>5</option><option value='6'>6</option><option value='7'>7</option><option value='8'>8</option><option value='9'>9</option><option value='10'>10</option><option value='15'>15</option><option value='20'>20</option><option value='25'>25</option><option value='30'>30</option><option value='35'>35</option><option value='40'>40</option></select></td></tr><tr><td class='label'>space:</td><td class='ctrl'><select name='ignorews' onchange='this.form.submit();'><option value='0' selected='selected'>include</option><option value='1'>ignore</option></select></td></tr><tr><td class='label'>mode:</td><td class='ctrl'><select name='dt' onchange='this.form.submit();'><option value='0' selected='selected'>unified</option><option value='1'>ssdiff</option><option value='2'>stat only</option></select></td></tr><tr><td/><td class='ctrl'><noscript><input type='submit' value='reload'/></noscript></td></tr></table></form></div><table summary='commit info' class='commit-info'>
<tr><th>author</th><td>Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;</td><td class='right'>2017-02-03 17:10:28 +1100</td></tr>
<tr><th>committer</th><td>Michael Ellerman &lt;mpe@ellerman.id.au&gt;</td><td class='right'>2017-02-08 23:36:29 +1100</td></tr>
<tr><th>commit</th><td colspan='2' class='oid'><a href='/cgit.cgi/linux/net-next.git/commit/sound/soc/intel/haswell/sst-haswell-ipc.h?id=d7df2443cd5f67fc6ee7c05a88e4996e8177f91b'>d7df2443cd5f67fc6ee7c05a88e4996e8177f91b</a> (<a href='/cgit.cgi/linux/net-next.git/patch/sound/soc/intel/haswell/sst-haswell-ipc.h?id=d7df2443cd5f67fc6ee7c05a88e4996e8177f91b'>patch</a>)</td></tr>
<tr><th>tree</th><td colspan='2' class='oid'><a href='/cgit.cgi/linux/net-next.git/tree/?id=d7df2443cd5f67fc6ee7c05a88e4996e8177f91b'>098a7c0ca4fceb8a65cb1f693c9d71990388933d</a> /<a href='/cgit.cgi/linux/net-next.git/tree/sound/soc/intel/haswell/sst-haswell-ipc.h?id=d7df2443cd5f67fc6ee7c05a88e4996e8177f91b'>sound/soc/intel/haswell/sst-haswell-ipc.h</a></td></tr>
<tr><th>parent</th><td colspan='2' class='oid'><a href='/cgit.cgi/linux/net-next.git/commit/sound/soc/intel/haswell/sst-haswell-ipc.h?id=a0615a16f7d0ceb5804d295203c302d496d8ee91'>a0615a16f7d0ceb5804d295203c302d496d8ee91</a> (<a href='/cgit.cgi/linux/net-next.git/diff/sound/soc/intel/haswell/sst-haswell-ipc.h?id=d7df2443cd5f67fc6ee7c05a88e4996e8177f91b&amp;id2=a0615a16f7d0ceb5804d295203c302d496d8ee91'>diff</a>)</td></tr></table>
<div class='commit-subject'>powerpc/mm: Fix spurrious segfaults on radix with autonuma</div><div class='commit-msg'>When autonuma (Automatic NUMA balancing) marks a PTE inaccessible it
clears all the protection bits but leave the PTE valid.

With the Radix MMU, an attempt at executing from such a PTE will
take a fault with bit 35 of SRR1 set "SRR1_ISI_N_OR_G".

It is thus incorrect to treat all such faults as errors. We should
pass them to handle_mm_fault() for autonuma to deal with. The case
of pages that are really not executable is handled by the existing
test for VM_EXEC further down.

That leaves us with catching the kernel attempts at executing user
pages. We can catch that earlier, even before we do find_vma.

It is never valid on powerpc for the kernel to take an exec fault
to begin with. So fold that test with the existing test for the
kernel faulting on kernel addresses to bail out early.

Fixes: 1d18ad026844 ("powerpc/mm: Detect instruction fetch denied and report")
Signed-off-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Reviewed-by: Aneesh Kumar K.V &lt;aneesh.kumar@linux.vnet.ibm.com&gt;
Acked-by: Balbir Singh &lt;bsingharora@gmail.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
</div><div class='diffstat-header'><a href='/cgit.cgi/linux/net-next.git/diff/?id=d7df2443cd5f67fc6ee7c05a88e4996e8177f91b'>Diffstat</a> (limited to 'sound/soc/intel/haswell/sst-haswell-ipc.h')</div><table summary='diffstat' class='diffstat'>