.. | .. |
---|
182 | 182 | struct net_device *ndev = priv->ndev; |
---|
183 | 183 | unsigned long flags; |
---|
184 | 184 | |
---|
| 185 | + /* Reject requests with unsupported flags */ |
---|
| 186 | + if (req->flags & ~(PTP_ENABLE_FEATURE | |
---|
| 187 | + PTP_RISING_EDGE | |
---|
| 188 | + PTP_FALLING_EDGE | |
---|
| 189 | + PTP_STRICT_FLAGS)) |
---|
| 190 | + return -EOPNOTSUPP; |
---|
| 191 | + |
---|
185 | 192 | if (req->index) |
---|
186 | 193 | return -EINVAL; |
---|
187 | 194 | |
---|
.. | .. |
---|
196 | 203 | ravb_write(ndev, GIE_PTCS, GIE); |
---|
197 | 204 | else |
---|
198 | 205 | ravb_write(ndev, GID_PTCD, GID); |
---|
199 | | - mmiowb(); |
---|
200 | 206 | spin_unlock_irqrestore(&priv->lock, flags); |
---|
201 | 207 | |
---|
202 | 208 | return 0; |
---|
.. | .. |
---|
211 | 217 | struct ravb_ptp_perout *perout; |
---|
212 | 218 | unsigned long flags; |
---|
213 | 219 | int error = 0; |
---|
| 220 | + |
---|
| 221 | + /* Reject requests with unsupported flags */ |
---|
| 222 | + if (req->flags) |
---|
| 223 | + return -EOPNOTSUPP; |
---|
214 | 224 | |
---|
215 | 225 | if (req->index) |
---|
216 | 226 | return -EINVAL; |
---|
.. | .. |
---|
259 | 269 | else |
---|
260 | 270 | ravb_write(ndev, GID_PTMD0, GID); |
---|
261 | 271 | } |
---|
262 | | - mmiowb(); |
---|
263 | 272 | spin_unlock_irqrestore(&priv->lock, flags); |
---|
264 | 273 | |
---|
265 | 274 | return error; |
---|
.. | .. |
---|
331 | 340 | spin_lock_irqsave(&priv->lock, flags); |
---|
332 | 341 | ravb_wait(ndev, GCCR, GCCR_TCR, GCCR_TCR_NOREQ); |
---|
333 | 342 | ravb_modify(ndev, GCCR, GCCR_TCSS, GCCR_TCSS_ADJGPTP); |
---|
334 | | - mmiowb(); |
---|
335 | 343 | spin_unlock_irqrestore(&priv->lock, flags); |
---|
336 | 344 | |
---|
337 | 345 | priv->ptp.clock = ptp_clock_register(&priv->ptp.info, &pdev->dev); |
---|