Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'sunxi-fixes-for-6.1-1' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into arm/fixes

- RSB bus communication fixes
- missing IOMMU reference property to H6 Hantro G2

* tag 'sunxi-fixes-for-6.1-1' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux:
arm64: dts: allwinner: h6: Add IOMMU reference to Hantro G2
media: dt-bindings: allwinner: h6-vpu-g2: Add IOMMU reference property
bus: sunxi-rsb: Support atomic transfers
bus: sunxi-rsb: Remove the shutdown callback

Link: https://lore.kernel.org/r/Y3ftpBFk5+fndA4B@jernej-laptop
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

+27 -17
+5
Documentation/devicetree/bindings/media/allwinner,sun50i-h6-vpu-g2.yaml
··· 36 36 resets: 37 37 maxItems: 1 38 38 39 + iommus: 40 + maxItems: 1 41 + 39 42 required: 40 43 - compatible 41 44 - reg ··· 46 43 - clocks 47 44 - clock-names 48 45 - resets 46 + - iommus 49 47 50 48 additionalProperties: false 51 49 ··· 63 59 clocks = <&ccu CLK_BUS_VP9>, <&ccu CLK_VP9>; 64 60 clock-names = "bus", "mod"; 65 61 resets = <&ccu RST_BUS_VP9>; 62 + iommus = <&iommu 5>; 66 63 }; 67 64 68 65 ...
+1
arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
··· 161 161 clocks = <&ccu CLK_BUS_VP9>, <&ccu CLK_VP9>; 162 162 clock-names = "bus", "mod"; 163 163 resets = <&ccu RST_BUS_VP9>; 164 + iommus = <&iommu 5>; 164 165 }; 165 166 166 167 video-codec@1c0e000 {
+21 -17
drivers/bus/sunxi-rsb.c
··· 267 267 /* common code that starts a transfer */ 268 268 static int _sunxi_rsb_run_xfer(struct sunxi_rsb *rsb) 269 269 { 270 + u32 int_mask, status; 271 + bool timeout; 272 + 270 273 if (readl(rsb->regs + RSB_CTRL) & RSB_CTRL_START_TRANS) { 271 274 dev_dbg(rsb->dev, "RSB transfer still in progress\n"); 272 275 return -EBUSY; ··· 277 274 278 275 reinit_completion(&rsb->complete); 279 276 280 - writel(RSB_INTS_LOAD_BSY | RSB_INTS_TRANS_ERR | RSB_INTS_TRANS_OVER, 281 - rsb->regs + RSB_INTE); 277 + int_mask = RSB_INTS_LOAD_BSY | RSB_INTS_TRANS_ERR | RSB_INTS_TRANS_OVER; 278 + writel(int_mask, rsb->regs + RSB_INTE); 282 279 writel(RSB_CTRL_START_TRANS | RSB_CTRL_GLOBAL_INT_ENB, 283 280 rsb->regs + RSB_CTRL); 284 281 285 - if (!wait_for_completion_io_timeout(&rsb->complete, 286 - msecs_to_jiffies(100))) { 282 + if (irqs_disabled()) { 283 + timeout = readl_poll_timeout_atomic(rsb->regs + RSB_INTS, 284 + status, (status & int_mask), 285 + 10, 100000); 286 + writel(status, rsb->regs + RSB_INTS); 287 + } else { 288 + timeout = !wait_for_completion_io_timeout(&rsb->complete, 289 + msecs_to_jiffies(100)); 290 + status = rsb->status; 291 + } 292 + 293 + if (timeout) { 287 294 dev_dbg(rsb->dev, "RSB timeout\n"); 288 295 289 296 /* abort the transfer */ ··· 305 292 return -ETIMEDOUT; 306 293 } 307 294 308 - if (rsb->status & RSB_INTS_LOAD_BSY) { 295 + if (status & RSB_INTS_LOAD_BSY) { 309 296 dev_dbg(rsb->dev, "RSB busy\n"); 310 297 return -EBUSY; 311 298 } 312 299 313 - if (rsb->status & RSB_INTS_TRANS_ERR) { 314 - if (rsb->status & RSB_INTS_TRANS_ERR_ACK) { 300 + if (status & RSB_INTS_TRANS_ERR) { 301 + if (status & RSB_INTS_TRANS_ERR_ACK) { 315 302 dev_dbg(rsb->dev, "RSB slave nack\n"); 316 303 return -EINVAL; 317 304 } 318 305 319 - if (rsb->status & RSB_INTS_TRANS_ERR_DATA) { 306 + if (status & RSB_INTS_TRANS_ERR_DATA) { 320 307 dev_dbg(rsb->dev, "RSB transfer data error\n"); 321 308 return -EIO; 322 309 } ··· 825 812 return 0; 826 813 } 827 814 828 - static void sunxi_rsb_shutdown(struct platform_device *pdev) 829 - { 830 - struct sunxi_rsb *rsb = platform_get_drvdata(pdev); 831 - 832 - pm_runtime_disable(&pdev->dev); 833 - sunxi_rsb_hw_exit(rsb); 834 - } 835 - 836 815 static const struct dev_pm_ops sunxi_rsb_dev_pm_ops = { 837 816 SET_RUNTIME_PM_OPS(sunxi_rsb_runtime_suspend, 838 817 sunxi_rsb_runtime_resume, NULL) ··· 840 835 static struct platform_driver sunxi_rsb_driver = { 841 836 .probe = sunxi_rsb_probe, 842 837 .remove = sunxi_rsb_remove, 843 - .shutdown = sunxi_rsb_shutdown, 844 838 .driver = { 845 839 .name = RSB_CTRL_NAME, 846 840 .of_match_table = sunxi_rsb_of_match_table,