提交 4277e6b9 编写于 作者: L Linus Torvalds

Merge tag 'mips_fixes_4.17_3' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux

Pull MIPS fixes from James Hogan:
 "A final few MIPS fixes for 4.17:

   - drop Lantiq gphy reboot/remove reset (4.14)

   - prctl(PR_SET_FP_MODE): Disallow PRE without FR (4.0)

   - ptrace(PTRACE_PEEKUSR): Fix 64-bit FGRs (3.15)"

* tag 'mips_fixes_4.17_3' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux:
  MIPS: ptrace: Fix PTRACE_PEEKUSR requests for 64-bit FGRs
  MIPS: prctl: Disallow FRE without FR with PR_SET_FP_MODE requests
  MIPS: lantiq: gphy: Drop reboot/remove reset asserts
...@@ -721,6 +721,10 @@ int mips_set_process_fp_mode(struct task_struct *task, unsigned int value) ...@@ -721,6 +721,10 @@ int mips_set_process_fp_mode(struct task_struct *task, unsigned int value)
if (value & ~known_bits) if (value & ~known_bits)
return -EOPNOTSUPP; return -EOPNOTSUPP;
/* Setting FRE without FR is not supported. */
if ((value & (PR_FP_MODE_FR | PR_FP_MODE_FRE)) == PR_FP_MODE_FRE)
return -EOPNOTSUPP;
/* Avoid inadvertently triggering emulation */ /* Avoid inadvertently triggering emulation */
if ((value & PR_FP_MODE_FR) && raw_cpu_has_fpu && if ((value & PR_FP_MODE_FR) && raw_cpu_has_fpu &&
!(raw_current_cpu_data.fpu_id & MIPS_FPIR_F64)) !(raw_current_cpu_data.fpu_id & MIPS_FPIR_F64))
......
...@@ -818,7 +818,7 @@ long arch_ptrace(struct task_struct *child, long request, ...@@ -818,7 +818,7 @@ long arch_ptrace(struct task_struct *child, long request,
break; break;
} }
#endif #endif
tmp = get_fpr32(&fregs[addr - FPR_BASE], 0); tmp = get_fpr64(&fregs[addr - FPR_BASE], 0);
break; break;
case PC: case PC:
tmp = regs->cp0_epc; tmp = regs->cp0_epc;
......
...@@ -109,7 +109,7 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request, ...@@ -109,7 +109,7 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
addr & 1); addr & 1);
break; break;
} }
tmp = get_fpr32(&fregs[addr - FPR_BASE], 0); tmp = get_fpr64(&fregs[addr - FPR_BASE], 0);
break; break;
case PC: case PC:
tmp = regs->cp0_epc; tmp = regs->cp0_epc;
......
...@@ -30,7 +30,6 @@ struct xway_gphy_priv { ...@@ -30,7 +30,6 @@ struct xway_gphy_priv {
struct clk *gphy_clk_gate; struct clk *gphy_clk_gate;
struct reset_control *gphy_reset; struct reset_control *gphy_reset;
struct reset_control *gphy_reset2; struct reset_control *gphy_reset2;
struct notifier_block gphy_reboot_nb;
void __iomem *membase; void __iomem *membase;
char *fw_name; char *fw_name;
}; };
...@@ -64,24 +63,6 @@ static const struct of_device_id xway_gphy_match[] = { ...@@ -64,24 +63,6 @@ static const struct of_device_id xway_gphy_match[] = {
}; };
MODULE_DEVICE_TABLE(of, xway_gphy_match); MODULE_DEVICE_TABLE(of, xway_gphy_match);
static struct xway_gphy_priv *to_xway_gphy_priv(struct notifier_block *nb)
{
return container_of(nb, struct xway_gphy_priv, gphy_reboot_nb);
}
static int xway_gphy_reboot_notify(struct notifier_block *reboot_nb,
unsigned long code, void *unused)
{
struct xway_gphy_priv *priv = to_xway_gphy_priv(reboot_nb);
if (priv) {
reset_control_assert(priv->gphy_reset);
reset_control_assert(priv->gphy_reset2);
}
return NOTIFY_DONE;
}
static int xway_gphy_load(struct device *dev, struct xway_gphy_priv *priv, static int xway_gphy_load(struct device *dev, struct xway_gphy_priv *priv,
dma_addr_t *dev_addr) dma_addr_t *dev_addr)
{ {
...@@ -205,14 +186,6 @@ static int xway_gphy_probe(struct platform_device *pdev) ...@@ -205,14 +186,6 @@ static int xway_gphy_probe(struct platform_device *pdev)
reset_control_deassert(priv->gphy_reset); reset_control_deassert(priv->gphy_reset);
reset_control_deassert(priv->gphy_reset2); reset_control_deassert(priv->gphy_reset2);
/* assert the gphy reset because it can hang after a reboot: */
priv->gphy_reboot_nb.notifier_call = xway_gphy_reboot_notify;
priv->gphy_reboot_nb.priority = -1;
ret = register_reboot_notifier(&priv->gphy_reboot_nb);
if (ret)
dev_warn(dev, "Failed to register reboot notifier\n");
platform_set_drvdata(pdev, priv); platform_set_drvdata(pdev, priv);
return ret; return ret;
...@@ -220,21 +193,12 @@ static int xway_gphy_probe(struct platform_device *pdev) ...@@ -220,21 +193,12 @@ static int xway_gphy_probe(struct platform_device *pdev)
static int xway_gphy_remove(struct platform_device *pdev) static int xway_gphy_remove(struct platform_device *pdev)
{ {
struct device *dev = &pdev->dev;
struct xway_gphy_priv *priv = platform_get_drvdata(pdev); struct xway_gphy_priv *priv = platform_get_drvdata(pdev);
int ret;
reset_control_assert(priv->gphy_reset);
reset_control_assert(priv->gphy_reset2);
iowrite32be(0, priv->membase); iowrite32be(0, priv->membase);
clk_disable_unprepare(priv->gphy_clk_gate); clk_disable_unprepare(priv->gphy_clk_gate);
ret = unregister_reboot_notifier(&priv->gphy_reboot_nb);
if (ret)
dev_warn(dev, "Failed to unregister reboot notifier\n");
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册