Skip to content

Commit 4277e6b

Browse files
committed
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
2 parents 7172a69 + c7e8146 commit 4277e6b

File tree

4 files changed

+6
-38
lines changed

4 files changed

+6
-38
lines changed

arch/mips/kernel/process.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,10 @@ int mips_set_process_fp_mode(struct task_struct *task, unsigned int value)
721721
if (value & ~known_bits)
722722
return -EOPNOTSUPP;
723723

724+
/* Setting FRE without FR is not supported. */
725+
if ((value & (PR_FP_MODE_FR | PR_FP_MODE_FRE)) == PR_FP_MODE_FRE)
726+
return -EOPNOTSUPP;
727+
724728
/* Avoid inadvertently triggering emulation */
725729
if ((value & PR_FP_MODE_FR) && raw_cpu_has_fpu &&
726730
!(raw_current_cpu_data.fpu_id & MIPS_FPIR_F64))

arch/mips/kernel/ptrace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,7 @@ long arch_ptrace(struct task_struct *child, long request,
818818
break;
819819
}
820820
#endif
821-
tmp = get_fpr32(&fregs[addr - FPR_BASE], 0);
821+
tmp = get_fpr64(&fregs[addr - FPR_BASE], 0);
822822
break;
823823
case PC:
824824
tmp = regs->cp0_epc;

arch/mips/kernel/ptrace32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
109109
addr & 1);
110110
break;
111111
}
112-
tmp = get_fpr32(&fregs[addr - FPR_BASE], 0);
112+
tmp = get_fpr64(&fregs[addr - FPR_BASE], 0);
113113
break;
114114
case PC:
115115
tmp = regs->cp0_epc;

drivers/soc/lantiq/gphy.c

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ struct xway_gphy_priv {
3030
struct clk *gphy_clk_gate;
3131
struct reset_control *gphy_reset;
3232
struct reset_control *gphy_reset2;
33-
struct notifier_block gphy_reboot_nb;
3433
void __iomem *membase;
3534
char *fw_name;
3635
};
@@ -64,24 +63,6 @@ static const struct of_device_id xway_gphy_match[] = {
6463
};
6564
MODULE_DEVICE_TABLE(of, xway_gphy_match);
6665

67-
static struct xway_gphy_priv *to_xway_gphy_priv(struct notifier_block *nb)
68-
{
69-
return container_of(nb, struct xway_gphy_priv, gphy_reboot_nb);
70-
}
71-
72-
static int xway_gphy_reboot_notify(struct notifier_block *reboot_nb,
73-
unsigned long code, void *unused)
74-
{
75-
struct xway_gphy_priv *priv = to_xway_gphy_priv(reboot_nb);
76-
77-
if (priv) {
78-
reset_control_assert(priv->gphy_reset);
79-
reset_control_assert(priv->gphy_reset2);
80-
}
81-
82-
return NOTIFY_DONE;
83-
}
84-
8566
static int xway_gphy_load(struct device *dev, struct xway_gphy_priv *priv,
8667
dma_addr_t *dev_addr)
8768
{
@@ -205,36 +186,19 @@ static int xway_gphy_probe(struct platform_device *pdev)
205186
reset_control_deassert(priv->gphy_reset);
206187
reset_control_deassert(priv->gphy_reset2);
207188

208-
/* assert the gphy reset because it can hang after a reboot: */
209-
priv->gphy_reboot_nb.notifier_call = xway_gphy_reboot_notify;
210-
priv->gphy_reboot_nb.priority = -1;
211-
212-
ret = register_reboot_notifier(&priv->gphy_reboot_nb);
213-
if (ret)
214-
dev_warn(dev, "Failed to register reboot notifier\n");
215-
216189
platform_set_drvdata(pdev, priv);
217190

218191
return ret;
219192
}
220193

221194
static int xway_gphy_remove(struct platform_device *pdev)
222195
{
223-
struct device *dev = &pdev->dev;
224196
struct xway_gphy_priv *priv = platform_get_drvdata(pdev);
225-
int ret;
226-
227-
reset_control_assert(priv->gphy_reset);
228-
reset_control_assert(priv->gphy_reset2);
229197

230198
iowrite32be(0, priv->membase);
231199

232200
clk_disable_unprepare(priv->gphy_clk_gate);
233201

234-
ret = unregister_reboot_notifier(&priv->gphy_reboot_nb);
235-
if (ret)
236-
dev_warn(dev, "Failed to unregister reboot notifier\n");
237-
238202
return 0;
239203
}
240204

0 commit comments

Comments
 (0)