All of lore.kernel.org
 help / color / mirror / Atom feed
* new SBus related DMA warnings in 4.18+git
@ 2018-08-26  7:48 ` Meelis Roos
  0 siblings, 0 replies; 22+ messages in thread
From: Meelis Roos @ 2018-08-26  7:48 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: sparclinux-u79uwXL29TY76Z2rM5mHXA,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA

Tried yesterdays git 4.18.0-12789-gaa5b105 on a Sun Ultra 1 with SBus 
and several SBus connected devicess give DMA mapping related warnings:

[    0.000272] PROMLIB: Sun IEEE Boot Prom 'OBP 3.35.0 2004/04/19 12:15'
[    0.000403] PROMLIB: Root node compatible: 
[    0.000861] Linux version 4.18.0-12789-gaa5b105 (mroos@melon) (gcc version 4.9.3 (Debian 4.9.3-2)) #181 Sat Aug 25 19:32:49 EEST 2018
[    0.271438] bootconsole [earlyprom0] enabled
[    0.322433] ARCH: SUN4U
[    0.351889] Ethernet address: 08:00:20:9f:6b:e4
[    0.405830] MM: PAGE_OFFSET is 0xfffff80000000000 (max_phys_bits = 40)
[    0.484959] MM: VMALLOC [0x0000000100000000 --> 0x0000060000000000]
[    0.559966] MM: VMEMMAP [0x0000060000000000 --> 0x00000c0000000000]
[    0.641129] Kernel: Using 2 locked TLB entries for main kernel image.
[    0.717545] Remapping the kernel... 
[    0.783535] done.
[    1.263372] OF stdout device is: /sbus@1f,0/zs@f,1100000:a
[    1.328169] PROM: Built device tree with 52656 bytes of memory.
[    1.399423] Top of RAM: 0x33f50000, Total RAM: 0x33f3e000
[    1.463595] Memory hole size: 0MB
[    1.515966] Allocated 16384 bytes for kernel page tables.
[    1.580408] Zone ranges:
[    1.609966]   Normal   [mem 0x0000000000000000-0x0000000033f4ffff]
[    1.683926] Movable zone start for each node
[    1.734974] Early memory node ranges
[    1.777700]   node   0: [mem 0x0000000000000000-0x0000000033efdfff]
[    1.852709]   node   0: [mem 0x0000000033f00000-0x0000000033f2bfff]
[    1.927716]   node   0: [mem 0x0000000033f3c000-0x0000000033f4ffff]
[    2.002904] Initmem setup node 0 [mem 0x0000000000000000-0x0000000033f4ffff]
[    2.087107] On node 0 totalpages: 106399
[    2.087126]   Normal zone: 832 pages used for memmap
[    2.087140]   Normal zone: 0 pages reserved
[    2.087160]   Normal zone: 106399 pages, LIFO batch:31
[    2.130356] Booting Linux...
[    2.163986] CPU CAPS: [flush,stbar,swap,muldiv,v9,mul32,div32,v8plus]
[    2.241064] CPU CAPS: [vis]
[    2.285004] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    2.285025] pcpu-alloc: [0] 0 
[    2.290171] Built 1 zonelists, mobility grouping on.  Total pages: 105567
[    2.370571] Kernel command line: root=/dev/sda2 ro scsi_mod.use_blk_mq=1
[    2.458819] Dentry cache hash table entries: 131072 (order: 7, 1048576 bytes)
[    2.547744] Inode-cache hash table entries: 65536 (order: 6, 524288 bytes)
[    2.629240] Sorting __ex_table...
[    2.743001] Memory: 835208K/851192K available (4226K kernel code, 288K rwdata, 952K rodata, 168K init, 205K bss, 15984K reserved, 0K cma-reserved)
[    2.901478] NR_IRQS: 2048, nr_irqs: 2048, preallocated irqs: 1
[    2.970823] clocksource: tick: mask: 0xffffffffffffffff max_cycles: 0x20f9d3d150, max_idle_ns: 440795205852 ns
[    3.090230] clocksource: mult[6fe715b] shift[24]
[    3.145440] clockevent: mult[249a6daa] shift[32]
[    3.202180] Console: colour dummy device 80x25
[    3.254591] console [tty0] enabled
[    3.295176] bootconsole [earlyprom0] disabled
[    3.497488] Calibrating delay using timer specific routine.. 287.03 BogoMIPS (lpj\x1435180)
[    3.497589] pid_max: default: 32768 minimum: 301
[    3.498727] Mount-cache hash table entries: 2048 (order: 1, 16384 bytes)
[    3.498859] Mountpoint-cache hash table entries: 2048 (order: 1, 16384 bytes)
[    3.505616] devtmpfs: initialized
[    3.514345] random: get_random_u32 called from bucket_table_alloc.isra.24+0x7c/0x1c0 with crng_init=0
[    3.515254] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    3.515355] futex hash table entries: 256 (order: -1, 6144 bytes)
[    3.516955] NET: Registered protocol family 16
[    3.536331] audit: initializing netlink subsys (disabled)
[    3.555514] SYSIO: UPA portID ffffffff, at 000001fe00000000
[    3.581737] audit: type 00 audit(0.230:1): state=initialized audit_enabled=0 res=1
[    3.616342] HugeTLB registered 64.0 KiB page size, pre-allocated 0 pages
[    3.616438] HugeTLB registered 8.00 MiB page size, pre-allocated 0 pages
[    3.616505] HugeTLB registered 256 MiB page size, pre-allocated 0 pages
[    3.616574] HugeTLB registered 2.00 GiB page size, pre-allocated 0 pages
[    3.621134] fbcon: Taking over console
[    3.622385] SCSI subsystem initialized
[    3.626204] mostek f005a1dc: DMA mask not set
[    3.626352] /sbus@1f,0/eeprom@f,1200000: Mostek regs at 0x1fff1200000
[    3.627907] auxio f0059f50: DMA mask not set
[    3.628041] AUXIO: Found device at /sbus@1f,0/auxio@f,1900000
[    3.628539] clocksource: Switched to clocksource tick
[    3.704804] NET: Registered protocol family 2
[    3.707441] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 8192 bytes)
[    3.707643] TCP established hash table entries: 8192 (order: 3, 65536 bytes)
[    3.708174] TCP bind hash table entries: 8192 (order: 3, 65536 bytes)
[    3.708746] TCP: Hash tables configured (established 8192 bind 8192)
[    3.709486] UDP hash table entries: 512 (order: 1, 16384 bytes)
[    3.709700] UDP-Lite hash table entries: 512 (order: 1, 16384 bytes)
[    3.710618] NET: Registered protocol family 1
[    3.721015] workingset: timestamp_bitsb max_order\x17 bucket_order=0
[    3.744635] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
[    3.744788] io scheduler noop registered
[    3.744863] io scheduler deadline registered
[    3.745120] io scheduler cfq registered (default)
[    3.749312] zs f005a290: DMA mask not set
[    3.749817] f005a290: ttyS0 at MMIO 0x1fff1100000 (irq = 9, base_baud = 307200) is a zs
[    3.749930] Console: ttyS0 (SunZilog zs0)
[    9.203008] console [ttyS0] enabled
[    9.245538] f005a290: ttyS1 at MMIO 0x1fff1100004 (irq = 9, base_baud = 307200) is a zs
[    9.341897] zs f005b730: DMA mask not set
[    9.388980] f005b730: Keyboard at MMIO 0x1fff1000000 (irq = 9) is a zs
[    9.466630] f005b730: Mouse at MMIO 0x1fff1000004 (irq = 9) is a zs
[    9.542716] esp f0062a74: DMA mask not set
[    9.595718] ------------[ cut here ]------------
[    9.649150] WARNING: CPU: 0 PID: 1 at ./include/linux/dma-mapping.h:516 esp_sbus_probe+0x57c/0x700
[    9.756374] Modules linked in:
[    9.792814] CPU: 0 PID: 1 Comm: swapper Not tainted 4.18.0-12789-gaa5b105 #181
[    9.879291] Call Trace:
[    9.908449]  [00000000006ec8dc] esp_sbus_probe+0x57c/0x700
[    9.974112]  [00000000006c0b8c] platform_drv_probe+0x2c/0xa0
[   10.041817]  [00000000006be9dc] really_probe+0x19c/0x2e0
[   10.105367]  [00000000006becd0] driver_probe_device+0x50/0x100
[   10.175165]  [00000000006bee74] __driver_attach+0xf4/0x120
[   10.240789]  [00000000006bcb24] bus_for_each_dev+0x44/0x80
[   10.306420]  [00000000006bddf8] bus_add_driver+0x198/0x220
[   10.372062]  [00000000006bf7f0] driver_register+0x70/0x120
[   10.437694]  [0000000000427310] do_one_initcall+0x30/0x180
[   10.503340]  [0000000000964af8] kernel_init_freeable+0x134/0x1d0
[   10.575198]  [000000000081f6a4] kernel_init+0x4/0x100
[   10.635633]  [0000000000405f64] ret_from_fork+0x1c/0x2c
[   10.698108]  [0000000000000000]           (null)
[   10.753340] ---[ end trace 3332d1d0348bd1ad ]---
[   10.809253] esp f0062a74: esp0: regs[(____ptrval____):(____ptrval____)] irq[10]
[   10.896097] esp f0062a74: esp0: is a FAS100A, 40 MHz (ccf=0), SCSI ID 7
[   14.039232] scsi host0: esp
[   14.072447] esp f00735ac: DMA mask not set
[   14.122675] scsi 0:0:0:0: Direct-Access     MAXTOR   ATLAS10K4_36SCA  DFV0 PQ: 0 ANSI: 3
[   14.217910] scsi target0:0:0: Beginning Domain Validation
[   14.284387] esp f00735ac: esp1: regs[(____ptrval____):(____ptrval____)] irq[14]
[   14.370147] esp f00735ac: esp1: is a FASHME, 40 MHz (ccf=0), SCSI ID 7
[   14.450462] scsi target0:0:0: FAST-10 SCSI 10.0 MB/s ST (100 ns, offset 15)
[   14.533386] scsi target0:0:0: Domain Validation skipping write tests
[   14.608015] scsi target0:0:0: Ending Domain Validation
[   14.669843] scsi 0:0:0:0: Power-on or device reset occurred
[   15.913404] scsi 0:0:6:0: CD-ROM            TOSHIBA  XM-5401TASUN4XCD 2565 PQ: 0 ANSI: 2
[   16.008606] scsi target0:0:6: Beginning Domain Validation
[   16.087230] scsi target0:0:6: FAST-5 SCSI 4.2 MB/s ST (236 ns, offset 15)
[   16.174368] scsi target0:0:6: Domain Validation skipping write tests
[   16.248596] scsi target0:0:6: Ending Domain Validation
[   17.479095] scsi host1: esp
[   17.516784] sd 0:0:0:0: [sda] 71833096 512-byte logical blocks: (36.8 GB/34.3 GiB)
[   17.609921] mousedev: PS/2 mouse device common for all mice
[   17.680502] sd 0:0:0:0: [sda] Write Protect is off
[   17.735982] sd 0:0:0:0: [sda] Mode Sense: ed 00 10 08
[   17.736678] rtc-m48t59 rtc-m48t59.0: registered as rtc0
[   17.800349] NET: Registered protocol family 17
[   17.851782] Key type dns_resolver registered
[   17.908257] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, supports DPO and FUA
[   18.012580] rtc-m48t59 rtc-m48t59.0: setting system clock to 2018-08-25 20:18:43 UTC (1535228323)
[   18.126394]  sda: sda1 sda2 sda3 sda4
[   18.179463] sd 0:0:0:0: [sda] Attached SCSI disk
[   18.680005] input: Sun Mouse as /devices/root/f0059940/f005b730/serio1/input/input1
[   21.223136] EXT4-fs (sda2): mounting ext3 file system using the ext4 subsystem
[   21.345645] EXT4-fs (sda2): mounted filesystem with ordered data mode. Opts: (null)
[   21.435626] VFS: Mounted root (ext3 filesystem) readonly on device 8:2.
[   21.515923] random: fast init done
[   21.576895] devtmpfs: mounted
[   21.611680] This architecture does not have kernel memory protection.
[   21.687612] Run /sbin/init as init process
[   25.945971] systemd-udevd[476]: starting version 215
[   26.331472] random: udevd: uninitialized urandom read (16 bytes read)
[   26.553702] random: udevd: uninitialized urandom read (16 bytes read)
[   27.443371] flash f0059fe0: DMA mask not set
[   27.492744] /sbus@1f,0/flashprom@f,0: OBP Flash, RD 1fff0000000[80000] WR 1fff1380000[80000]
[   27.749840] sd 0:0:0:0: Attached scsi generic sg0 type 0
[   27.838931] bpp f0069908: DMA mask not set
[   27.886682] parport0: sunbpp at 0x1ffec800000
[   27.972907] sr 0:0:6:0: Power-on or device reset occurred
[   28.041976] sunlance f006707c: DMA mask not set
[   28.094563] sunlance.c:v2.02 8/24/03 Miguel de Icaza (miguel@nuclecu.unam.mx)
[   28.179719] ------------[ cut here ]------------
[   28.234971] WARNING: CPU: 0 PID: 519 at ./include/linux/dma-mapping.h:516 sparc_lance_probe_one+0x37c/0x4c0 [sunlance]
[   28.363071] Modules linked in: sunlance(+) sr_mod(+) snd_pcm parport_sunbpp(+) cdrom parport sg(+) snd_timer snd flash(+) evdev soundcore
[   28.511044] CPU: 0 PID: 519 Comm: udevd Tainted: G        W         4.18.0-12789-gaa5b105 #181
[   28.614135] Call Trace:
[   28.643306]  [00000000100a1f7c] sparc_lance_probe_one+0x37c/0x4c0 [sunlance]
[   28.727713]  [00000000006c0b8c] platform_drv_probe+0x2c/0xa0
[   28.795403]  [00000000006be9dc] really_probe+0x19c/0x2e0
[   28.858966]  [00000000006becd0] driver_probe_device+0x50/0x100
[   28.928754]  [00000000006bee74] __driver_attach+0xf4/0x120
[   28.994381]  [00000000006bcb24] bus_for_each_dev+0x44/0x80
[   29.060007]  [00000000006bddf8] bus_add_driver+0x198/0x220
[   29.125642]  [00000000006bf7f0] driver_register+0x70/0x120
[   29.191279]  [0000000000427310] do_one_initcall+0x30/0x180
[   29.256917]  [00000000004ab0f0] do_init_module+0x4c/0x1bc
[   29.321504]  [00000000004aa408] load_module+0x1bc8/0x2020
[   29.386094]  [00000000004aa9d4] sys_finit_module+0x74/0xa0
[   29.451731]  [00000000004060b4] linux_sparc_syscall32+0x34/0x60
[   29.522544] ---[ end trace 3332d1d0348bd1af ]---
[   29.578176] SunLance: using auto-carrier-detection.
[   29.638121] eth0: LANCE 08:00:20:9f:6b:e4
[   29.688200] hme f006be34: DMA mask not set
[   29.735421] sunhme.c:v3.10 August 26, 2008 David S. Miller (davem@davemloft.net)
[   29.823899] ------------[ cut here ]------------
[   29.879121] WARNING: CPU: 0 PID: 523 at ./include/linux/dma-mapping.h:516 hme_sbus_probe+0x898/0x9c0 [sunhme]
[   29.997837] Modules linked in: sunhme(+) sunlance sr_mod(+) snd_pcm parport_sunbpp(+) cdrom parport sg(+) snd_timer snd flash(+) evdev soundcore
[   30.153104] CPU: 0 PID: 523 Comm: udevd Tainted: G        W         4.18.0-12789-gaa5b105 #181
[   30.256194] Call Trace:
[   30.285369]  [00000000100ac8b8] hme_sbus_probe+0x898/0x9c0 [sunhme]
[   30.360387]  [00000000006c0b8c] platform_drv_probe+0x2c/0xa0
[   30.428089]  [00000000006be9dc] really_probe+0x19c/0x2e0
[   30.491640]  [00000000006becd0] driver_probe_device+0x50/0x100
[   30.561442]  [00000000006bee74] __driver_attach+0xf4/0x120
[   30.627062]  [00000000006bcb24] bus_for_each_dev+0x44/0x80
[   30.692693]  [00000000006bddf8] bus_add_driver+0x198/0x220
[   30.758330]  [00000000006bf7f0] driver_register+0x70/0x120
[   30.823989]  [00000000100b2010] happy_meal_probe+0x10/0xc0 [sunhme]
[   30.898976]  [0000000000427310] do_one_initcall+0x30/0x180
[   30.964614]  [00000000004ab0f0] do_init_module+0x4c/0x1bc
[   31.029194]  [00000000004aa408] load_module+0x1bc8/0x2020
[   31.093786]  [00000000004aa9d4] sys_finit_module+0x74/0xa0
[   31.159423]  [00000000004060b4] linux_sparc_syscall32+0x34/0x60
[   31.230233] ---[ end trace 3332d1d0348bd1b0 ]---
[   31.287904] eth1: HAPPY MEAL (SBUS) 10/100baseT Ethernet 
[   31.287923] 08:00:20:9f:6b:e4
[   31.407985] qpti f00798c4: DMA mask not set
[   31.468397] sr 0:0:6:0: [sr0] scsi-1 drive
[   31.515534] cdrom: Uniform CD-ROM driver Revision: 3.20
[   31.604507] audio f0059e44: DMA mask not set
[   31.789408] qlogicpti0: IRQ 15 
[   31.789519] SCSI ID 7 
[   31.825285] ------------[ cut here ]------------
[   31.908745] WARNING: CPU: 0 PID: 525 at ./include/linux/dma-mapping.h:516 qpti_sbus_probe+0x450/0x1630 [qlogicpti]
[   32.032526] Modules linked in: snd_sun_cs4231(+) qlogicpti(+) sunhme sunlance sr_mod(+) snd_pcm parport_sunbpp(+) cdrom parport sg(+) snd_timer snd flash(+) evdev soundcore
[   32.216985] CPU: 0 PID: 525 Comm: udevd Tainted: G        W         4.18.0-12789-gaa5b105 #181
[   32.320052] Call Trace:
[   32.349211]  [00000000100b75f0] qpti_sbus_probe+0x450/0x1630 [qlogicpti]
[   32.429454]  [00000000006c0b8c] platform_drv_probe+0x2c/0xa0
[   32.497149]  [00000000006be9dc] really_probe+0x19c/0x2e0
[   32.560708]  [00000000006becd0] driver_probe_device+0x50/0x100
[   32.630527]  [00000000006bee74] __driver_attach+0xf4/0x120
[   32.696144]  [00000000006bcb24] bus_for_each_dev+0x44/0x80
[   32.761760]  [00000000006bddf8] bus_add_driver+0x198/0x220
[   32.827396]  [00000000006bf7f0] driver_register+0x70/0x120
[   32.893031]  [0000000000427310] do_one_initcall+0x30/0x180
[   32.958669]  [00000000004ab0f0] do_init_module+0x4c/0x1bc
[   33.023251]  [00000000004aa408] load_module+0x1bc8/0x2020
[   33.087843]  [00000000004aa9d4] sys_finit_module+0x74/0xa0
[   33.153481]  [00000000004060b4] linux_sparc_syscall32+0x34/0x60
[   33.224294] ---[ end trace 3332d1d0348bd1b1 ]---
[   33.282263] sr 0:0:6:0: Attached scsi generic sg1 type 5
[   33.499951] ------------[ cut here ]------------
[   33.553491] WARNING: CPU: 0 PID: 513 at ./include/linux/dma-mapping.h:516 snd_dma_alloc_pages+0x180/0x1a0 [snd_pcm]
[   33.678318] Modules linked in: snd_sun_cs4231(+) qlogicpti(+) sunhme sunlance sr_mod(+) snd_pcm parport_sunbpp(+) cdrom parport sg snd_timer snd flash(+) evdev soundcore
[   33.859660] CPU: 0 PID: 513 Comm: udevd Tainted: G        W         4.18.0-12789-gaa5b105 #181
[   33.962781] Call Trace:
[   33.991950]  [00000000100830c0] snd_dma_alloc_pages+0x180/0x1a0 [snd_pcm]
[   34.073225]  [0000000010082838] snd_pcm_lib_preallocate_pages1+0x118/0x1a0 [snd_pcm]
[   34.165966]  [0000000010082918] snd_pcm_lib_preallocate_pages_for_all+0x38/0x80 [snd_pcm]
[   34.263873]  [00000000100c1e38] cs4231_probe+0x638/0x7e0 [snd_sun_cs4231]
[   34.345074]  [00000000006c0b8c] platform_drv_probe+0x2c/0xa0
[   34.412771]  [00000000006be9dc] really_probe+0x19c/0x2e0
[   34.476319]  [00000000006becd0] driver_probe_device+0x50/0x100
[   34.546119]  [00000000006bee74] __driver_attach+0xf4/0x120
[   34.611747]  [00000000006bcb24] bus_for_each_dev+0x44/0x80
[   34.677373]  [00000000006bddf8] bus_add_driver+0x198/0x220
[   34.743010]  [00000000006bf7f0] driver_register+0x70/0x120
[   34.808643]  [0000000000427310] do_one_initcall+0x30/0x180
[   34.874288]  [00000000004ab0f0] do_init_module+0x4c/0x1bc
[   34.938866]  [00000000004aa408] load_module+0x1bc8/0x2020
[   35.003457]  [00000000004aa9d4] sys_finit_module+0x74/0xa0
[   35.069095]  [00000000004060b4] linux_sparc_syscall32+0x34/0x60
[   35.139904] ---[ end trace 3332d1d0348bd1b2 ]---
[   35.286257] sr 0:0:6:0: Attached scsi CD-ROM sr0
[   36.283976] sd 0:0:0:0: [sda] tag#4 FAILED Result: hostbyte=DID_ABORT driverbyte=DRIVER_OK
[   36.381331] sd 0:0:0:0: [sda] tag#4 CDB: ATA command pass through(16) 85 06 20 00 05 00 fe 00 00 00 00 00 00 40 ef 00
[   37.266190] sd 0:0:0:0: [sda] tag#2 FAILED Result: hostbyte=DID_ABORT driverbyte=DRIVER_OK
[   37.363525] sd 0:0:0:0: [sda] tag#2 CDB: ATA command pass through(16) 85 06 20 00 05 00 fe 00 00 00 00 00 00 40 ef 00
[   37.765963] sunlance f006707c rename2: renamed from eth0
[   37.831623] hme f006be34 eth0: renamed from eth1
[   38.320369] (Firmware v1.31.32)
[   38.320401] (FCode 1.21 95/05/18)
[   38.356199] 
               qlogicpti0: [Fast Wide, using single ended interface]
[   38.486325] scsi host2: PTI Qlogic,ISP SBUS SCSI irq 15 regs at (____ptrval____)
[   38.736044] sd 0:0:0:0: [sda] tag#1 FAILED Result: hostbyte=DID_ABORT driverbyte=DRIVER_OK
[   38.833349] sd 0:0:0:0: [sda] tag#1 CDB: ATA command pass through(16) 85 06 20 00 05 00 fe 00 00 00 00 00 00 40 ef 00
[   38.994170] systemd-udevd[519]: renamed network interface eth1 to eth0
[   39.100116] systemd-udevd[516]: renamed network interface eth0 to rename2
[   39.266082] sd 0:0:0:0: [sda] tag#1 FAILED Result: hostbyte=DID_ABORT driverbyte=DRIVER_OK
[   39.363408] sd 0:0:0:0: [sda] tag#1 CDB: ATA command pass through(16) 85 06 20 00 05 00 fe 00 00 00 00 00 00 40 ef 00
[   39.605965] sd 0:0:0:0: [sda] tag#1 FAILED Result: hostbyte=DID_ABORT driverbyte=DRIVER_OK
[   39.703275] sd 0:0:0:0: [sda] tag#1 CDB: ATA command pass through(16) 85 06 20 00 05 00 fe 00 00 00 00 00 00 40 ef 00
[   39.916597] sunlance f006707c eth1: renamed from rename2
[   40.119269] systemd-udevd[516]: renamed network interface eth0 to eth1
[   41.033237] Adding 360440k swap on /dev/sda4.  Priority:-2 extents:1 across:360440k 
[   41.441029] EXT4-fs (sda2): re-mounted. Opts: (null)
[   42.110875] EXT4-fs (sda2): re-mounted. Opts: errors=remount-ro
[   47.809743] NET: Registered protocol family 10
[   47.868327] Segment Routing with IPv6
[   49.196386] EXT4-fs (sda1): mounting ext3 file system using the ext4 subsystem
[   49.298784] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
[   54.513618] random: dd: uninitialized urandom read (512 bytes read)
[   59.720440] eth0: Link is up using 
[   59.720459] internal 
[   59.760188] transceiver at 
[   59.787280] 100Mb/s, Full Duplex.
[   64.259942] random: crng init done

-- 
Meelis Roos (mroos@linux.ee)

^ permalink raw reply	[flat|nested] 22+ messages in thread

* new SBus related DMA warnings in 4.18+git
@ 2018-08-26  7:48 ` Meelis Roos
  0 siblings, 0 replies; 22+ messages in thread
From: Meelis Roos @ 2018-08-26  7:48 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: sparclinux-u79uwXL29TY76Z2rM5mHXA,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA

Tried yesterdays git 4.18.0-12789-gaa5b105 on a Sun Ultra 1 with SBus 
and several SBus connected devicess give DMA mapping related warnings:

[    0.000272] PROMLIB: Sun IEEE Boot Prom 'OBP 3.35.0 2004/04/19 12:15'
[    0.000403] PROMLIB: Root node compatible: 
[    0.000861] Linux version 4.18.0-12789-gaa5b105 (mroos@melon) (gcc version 4.9.3 (Debian 4.9.3-2)) #181 Sat Aug 25 19:32:49 EEST 2018
[    0.271438] bootconsole [earlyprom0] enabled
[    0.322433] ARCH: SUN4U
[    0.351889] Ethernet address: 08:00:20:9f:6b:e4
[    0.405830] MM: PAGE_OFFSET is 0xfffff80000000000 (max_phys_bits == 40)
[    0.484959] MM: VMALLOC [0x0000000100000000 --> 0x0000060000000000]
[    0.559966] MM: VMEMMAP [0x0000060000000000 --> 0x00000c0000000000]
[    0.641129] Kernel: Using 2 locked TLB entries for main kernel image.
[    0.717545] Remapping the kernel... 
[    0.783535] done.
[    1.263372] OF stdout device is: /sbus@1f,0/zs@f,1100000:a
[    1.328169] PROM: Built device tree with 52656 bytes of memory.
[    1.399423] Top of RAM: 0x33f50000, Total RAM: 0x33f3e000
[    1.463595] Memory hole size: 0MB
[    1.515966] Allocated 16384 bytes for kernel page tables.
[    1.580408] Zone ranges:
[    1.609966]   Normal   [mem 0x0000000000000000-0x0000000033f4ffff]
[    1.683926] Movable zone start for each node
[    1.734974] Early memory node ranges
[    1.777700]   node   0: [mem 0x0000000000000000-0x0000000033efdfff]
[    1.852709]   node   0: [mem 0x0000000033f00000-0x0000000033f2bfff]
[    1.927716]   node   0: [mem 0x0000000033f3c000-0x0000000033f4ffff]
[    2.002904] Initmem setup node 0 [mem 0x0000000000000000-0x0000000033f4ffff]
[    2.087107] On node 0 totalpages: 106399
[    2.087126]   Normal zone: 832 pages used for memmap
[    2.087140]   Normal zone: 0 pages reserved
[    2.087160]   Normal zone: 106399 pages, LIFO batch:31
[    2.130356] Booting Linux...
[    2.163986] CPU CAPS: [flush,stbar,swap,muldiv,v9,mul32,div32,v8plus]
[    2.241064] CPU CAPS: [vis]
[    2.285004] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    2.285025] pcpu-alloc: [0] 0 
[    2.290171] Built 1 zonelists, mobility grouping on.  Total pages: 105567
[    2.370571] Kernel command line: root=/dev/sda2 ro scsi_mod.use_blk_mq=1
[    2.458819] Dentry cache hash table entries: 131072 (order: 7, 1048576 bytes)
[    2.547744] Inode-cache hash table entries: 65536 (order: 6, 524288 bytes)
[    2.629240] Sorting __ex_table...
[    2.743001] Memory: 835208K/851192K available (4226K kernel code, 288K rwdata, 952K rodata, 168K init, 205K bss, 15984K reserved, 0K cma-reserved)
[    2.901478] NR_IRQS: 2048, nr_irqs: 2048, preallocated irqs: 1
[    2.970823] clocksource: tick: mask: 0xffffffffffffffff max_cycles: 0x20f9d3d150, max_idle_ns: 440795205852 ns
[    3.090230] clocksource: mult[6fe715b] shift[24]
[    3.145440] clockevent: mult[249a6daa] shift[32]
[    3.202180] Console: colour dummy device 80x25
[    3.254591] console [tty0] enabled
[    3.295176] bootconsole [earlyprom0] disabled
[    3.497488] Calibrating delay using timer specific routine.. 287.03 BogoMIPS (lpj=1435180)
[    3.497589] pid_max: default: 32768 minimum: 301
[    3.498727] Mount-cache hash table entries: 2048 (order: 1, 16384 bytes)
[    3.498859] Mountpoint-cache hash table entries: 2048 (order: 1, 16384 bytes)
[    3.505616] devtmpfs: initialized
[    3.514345] random: get_random_u32 called from bucket_table_alloc.isra.24+0x7c/0x1c0 with crng_init=0
[    3.515254] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    3.515355] futex hash table entries: 256 (order: -1, 6144 bytes)
[    3.516955] NET: Registered protocol family 16
[    3.536331] audit: initializing netlink subsys (disabled)
[    3.555514] SYSIO: UPA portID ffffffff, at 000001fe00000000
[    3.581737] audit: type=2000 audit(0.230:1): state=initialized audit_enabled=0 res=1
[    3.616342] HugeTLB registered 64.0 KiB page size, pre-allocated 0 pages
[    3.616438] HugeTLB registered 8.00 MiB page size, pre-allocated 0 pages
[    3.616505] HugeTLB registered 256 MiB page size, pre-allocated 0 pages
[    3.616574] HugeTLB registered 2.00 GiB page size, pre-allocated 0 pages
[    3.621134] fbcon: Taking over console
[    3.622385] SCSI subsystem initialized
[    3.626204] mostek f005a1dc: DMA mask not set
[    3.626352] /sbus@1f,0/eeprom@f,1200000: Mostek regs at 0x1fff1200000
[    3.627907] auxio f0059f50: DMA mask not set
[    3.628041] AUXIO: Found device at /sbus@1f,0/auxio@f,1900000
[    3.628539] clocksource: Switched to clocksource tick
[    3.704804] NET: Registered protocol family 2
[    3.707441] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 8192 bytes)
[    3.707643] TCP established hash table entries: 8192 (order: 3, 65536 bytes)
[    3.708174] TCP bind hash table entries: 8192 (order: 3, 65536 bytes)
[    3.708746] TCP: Hash tables configured (established 8192 bind 8192)
[    3.709486] UDP hash table entries: 512 (order: 1, 16384 bytes)
[    3.709700] UDP-Lite hash table entries: 512 (order: 1, 16384 bytes)
[    3.710618] NET: Registered protocol family 1
[    3.721015] workingset: timestamp_bits=62 max_order=17 bucket_order=0
[    3.744635] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
[    3.744788] io scheduler noop registered
[    3.744863] io scheduler deadline registered
[    3.745120] io scheduler cfq registered (default)
[    3.749312] zs f005a290: DMA mask not set
[    3.749817] f005a290: ttyS0 at MMIO 0x1fff1100000 (irq = 9, base_baud = 307200) is a zs
[    3.749930] Console: ttyS0 (SunZilog zs0)
[    9.203008] console [ttyS0] enabled
[    9.245538] f005a290: ttyS1 at MMIO 0x1fff1100004 (irq = 9, base_baud = 307200) is a zs
[    9.341897] zs f005b730: DMA mask not set
[    9.388980] f005b730: Keyboard at MMIO 0x1fff1000000 (irq = 9) is a zs
[    9.466630] f005b730: Mouse at MMIO 0x1fff1000004 (irq = 9) is a zs
[    9.542716] esp f0062a74: DMA mask not set
[    9.595718] ------------[ cut here ]------------
[    9.649150] WARNING: CPU: 0 PID: 1 at ./include/linux/dma-mapping.h:516 esp_sbus_probe+0x57c/0x700
[    9.756374] Modules linked in:
[    9.792814] CPU: 0 PID: 1 Comm: swapper Not tainted 4.18.0-12789-gaa5b105 #181
[    9.879291] Call Trace:
[    9.908449]  [00000000006ec8dc] esp_sbus_probe+0x57c/0x700
[    9.974112]  [00000000006c0b8c] platform_drv_probe+0x2c/0xa0
[   10.041817]  [00000000006be9dc] really_probe+0x19c/0x2e0
[   10.105367]  [00000000006becd0] driver_probe_device+0x50/0x100
[   10.175165]  [00000000006bee74] __driver_attach+0xf4/0x120
[   10.240789]  [00000000006bcb24] bus_for_each_dev+0x44/0x80
[   10.306420]  [00000000006bddf8] bus_add_driver+0x198/0x220
[   10.372062]  [00000000006bf7f0] driver_register+0x70/0x120
[   10.437694]  [0000000000427310] do_one_initcall+0x30/0x180
[   10.503340]  [0000000000964af8] kernel_init_freeable+0x134/0x1d0
[   10.575198]  [000000000081f6a4] kernel_init+0x4/0x100
[   10.635633]  [0000000000405f64] ret_from_fork+0x1c/0x2c
[   10.698108]  [0000000000000000]           (null)
[   10.753340] ---[ end trace 3332d1d0348bd1ad ]---
[   10.809253] esp f0062a74: esp0: regs[(____ptrval____):(____ptrval____)] irq[10]
[   10.896097] esp f0062a74: esp0: is a FAS100A, 40 MHz (ccf=0), SCSI ID 7
[   14.039232] scsi host0: esp
[   14.072447] esp f00735ac: DMA mask not set
[   14.122675] scsi 0:0:0:0: Direct-Access     MAXTOR   ATLAS10K4_36SCA  DFV0 PQ: 0 ANSI: 3
[   14.217910] scsi target0:0:0: Beginning Domain Validation
[   14.284387] esp f00735ac: esp1: regs[(____ptrval____):(____ptrval____)] irq[14]
[   14.370147] esp f00735ac: esp1: is a FASHME, 40 MHz (ccf=0), SCSI ID 7
[   14.450462] scsi target0:0:0: FAST-10 SCSI 10.0 MB/s ST (100 ns, offset 15)
[   14.533386] scsi target0:0:0: Domain Validation skipping write tests
[   14.608015] scsi target0:0:0: Ending Domain Validation
[   14.669843] scsi 0:0:0:0: Power-on or device reset occurred
[   15.913404] scsi 0:0:6:0: CD-ROM            TOSHIBA  XM-5401TASUN4XCD 2565 PQ: 0 ANSI: 2
[   16.008606] scsi target0:0:6: Beginning Domain Validation
[   16.087230] scsi target0:0:6: FAST-5 SCSI 4.2 MB/s ST (236 ns, offset 15)
[   16.174368] scsi target0:0:6: Domain Validation skipping write tests
[   16.248596] scsi target0:0:6: Ending Domain Validation
[   17.479095] scsi host1: esp
[   17.516784] sd 0:0:0:0: [sda] 71833096 512-byte logical blocks: (36.8 GB/34.3 GiB)
[   17.609921] mousedev: PS/2 mouse device common for all mice
[   17.680502] sd 0:0:0:0: [sda] Write Protect is off
[   17.735982] sd 0:0:0:0: [sda] Mode Sense: ed 00 10 08
[   17.736678] rtc-m48t59 rtc-m48t59.0: registered as rtc0
[   17.800349] NET: Registered protocol family 17
[   17.851782] Key type dns_resolver registered
[   17.908257] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, supports DPO and FUA
[   18.012580] rtc-m48t59 rtc-m48t59.0: setting system clock to 2018-08-25 20:18:43 UTC (1535228323)
[   18.126394]  sda: sda1 sda2 sda3 sda4
[   18.179463] sd 0:0:0:0: [sda] Attached SCSI disk
[   18.680005] input: Sun Mouse as /devices/root/f0059940/f005b730/serio1/input/input1
[   21.223136] EXT4-fs (sda2): mounting ext3 file system using the ext4 subsystem
[   21.345645] EXT4-fs (sda2): mounted filesystem with ordered data mode. Opts: (null)
[   21.435626] VFS: Mounted root (ext3 filesystem) readonly on device 8:2.
[   21.515923] random: fast init done
[   21.576895] devtmpfs: mounted
[   21.611680] This architecture does not have kernel memory protection.
[   21.687612] Run /sbin/init as init process
[   25.945971] systemd-udevd[476]: starting version 215
[   26.331472] random: udevd: uninitialized urandom read (16 bytes read)
[   26.553702] random: udevd: uninitialized urandom read (16 bytes read)
[   27.443371] flash f0059fe0: DMA mask not set
[   27.492744] /sbus@1f,0/flashprom@f,0: OBP Flash, RD 1fff0000000[80000] WR 1fff1380000[80000]
[   27.749840] sd 0:0:0:0: Attached scsi generic sg0 type 0
[   27.838931] bpp f0069908: DMA mask not set
[   27.886682] parport0: sunbpp at 0x1ffec800000
[   27.972907] sr 0:0:6:0: Power-on or device reset occurred
[   28.041976] sunlance f006707c: DMA mask not set
[   28.094563] sunlance.c:v2.02 8/24/03 Miguel de Icaza (miguel-l0k2tD8exuLh6aauSPI5SQ@public.gmane.org)
[   28.179719] ------------[ cut here ]------------
[   28.234971] WARNING: CPU: 0 PID: 519 at ./include/linux/dma-mapping.h:516 sparc_lance_probe_one+0x37c/0x4c0 [sunlance]
[   28.363071] Modules linked in: sunlance(+) sr_mod(+) snd_pcm parport_sunbpp(+) cdrom parport sg(+) snd_timer snd flash(+) evdev soundcore
[   28.511044] CPU: 0 PID: 519 Comm: udevd Tainted: G        W         4.18.0-12789-gaa5b105 #181
[   28.614135] Call Trace:
[   28.643306]  [00000000100a1f7c] sparc_lance_probe_one+0x37c/0x4c0 [sunlance]
[   28.727713]  [00000000006c0b8c] platform_drv_probe+0x2c/0xa0
[   28.795403]  [00000000006be9dc] really_probe+0x19c/0x2e0
[   28.858966]  [00000000006becd0] driver_probe_device+0x50/0x100
[   28.928754]  [00000000006bee74] __driver_attach+0xf4/0x120
[   28.994381]  [00000000006bcb24] bus_for_each_dev+0x44/0x80
[   29.060007]  [00000000006bddf8] bus_add_driver+0x198/0x220
[   29.125642]  [00000000006bf7f0] driver_register+0x70/0x120
[   29.191279]  [0000000000427310] do_one_initcall+0x30/0x180
[   29.256917]  [00000000004ab0f0] do_init_module+0x4c/0x1bc
[   29.321504]  [00000000004aa408] load_module+0x1bc8/0x2020
[   29.386094]  [00000000004aa9d4] sys_finit_module+0x74/0xa0
[   29.451731]  [00000000004060b4] linux_sparc_syscall32+0x34/0x60
[   29.522544] ---[ end trace 3332d1d0348bd1af ]---
[   29.578176] SunLance: using auto-carrier-detection.
[   29.638121] eth0: LANCE 08:00:20:9f:6b:e4
[   29.688200] hme f006be34: DMA mask not set
[   29.735421] sunhme.c:v3.10 August 26, 2008 David S. Miller (davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org)
[   29.823899] ------------[ cut here ]------------
[   29.879121] WARNING: CPU: 0 PID: 523 at ./include/linux/dma-mapping.h:516 hme_sbus_probe+0x898/0x9c0 [sunhme]
[   29.997837] Modules linked in: sunhme(+) sunlance sr_mod(+) snd_pcm parport_sunbpp(+) cdrom parport sg(+) snd_timer snd flash(+) evdev soundcore
[   30.153104] CPU: 0 PID: 523 Comm: udevd Tainted: G        W         4.18.0-12789-gaa5b105 #181
[   30.256194] Call Trace:
[   30.285369]  [00000000100ac8b8] hme_sbus_probe+0x898/0x9c0 [sunhme]
[   30.360387]  [00000000006c0b8c] platform_drv_probe+0x2c/0xa0
[   30.428089]  [00000000006be9dc] really_probe+0x19c/0x2e0
[   30.491640]  [00000000006becd0] driver_probe_device+0x50/0x100
[   30.561442]  [00000000006bee74] __driver_attach+0xf4/0x120
[   30.627062]  [00000000006bcb24] bus_for_each_dev+0x44/0x80
[   30.692693]  [00000000006bddf8] bus_add_driver+0x198/0x220
[   30.758330]  [00000000006bf7f0] driver_register+0x70/0x120
[   30.823989]  [00000000100b2010] happy_meal_probe+0x10/0xc0 [sunhme]
[   30.898976]  [0000000000427310] do_one_initcall+0x30/0x180
[   30.964614]  [00000000004ab0f0] do_init_module+0x4c/0x1bc
[   31.029194]  [00000000004aa408] load_module+0x1bc8/0x2020
[   31.093786]  [00000000004aa9d4] sys_finit_module+0x74/0xa0
[   31.159423]  [00000000004060b4] linux_sparc_syscall32+0x34/0x60
[   31.230233] ---[ end trace 3332d1d0348bd1b0 ]---
[   31.287904] eth1: HAPPY MEAL (SBUS) 10/100baseT Ethernet 
[   31.287923] 08:00:20:9f:6b:e4
[   31.407985] qpti f00798c4: DMA mask not set
[   31.468397] sr 0:0:6:0: [sr0] scsi-1 drive
[   31.515534] cdrom: Uniform CD-ROM driver Revision: 3.20
[   31.604507] audio f0059e44: DMA mask not set
[   31.789408] qlogicpti0: IRQ 15 
[   31.789519] SCSI ID 7 
[   31.825285] ------------[ cut here ]------------
[   31.908745] WARNING: CPU: 0 PID: 525 at ./include/linux/dma-mapping.h:516 qpti_sbus_probe+0x450/0x1630 [qlogicpti]
[   32.032526] Modules linked in: snd_sun_cs4231(+) qlogicpti(+) sunhme sunlance sr_mod(+) snd_pcm parport_sunbpp(+) cdrom parport sg(+) snd_timer snd flash(+) evdev soundcore
[   32.216985] CPU: 0 PID: 525 Comm: udevd Tainted: G        W         4.18.0-12789-gaa5b105 #181
[   32.320052] Call Trace:
[   32.349211]  [00000000100b75f0] qpti_sbus_probe+0x450/0x1630 [qlogicpti]
[   32.429454]  [00000000006c0b8c] platform_drv_probe+0x2c/0xa0
[   32.497149]  [00000000006be9dc] really_probe+0x19c/0x2e0
[   32.560708]  [00000000006becd0] driver_probe_device+0x50/0x100
[   32.630527]  [00000000006bee74] __driver_attach+0xf4/0x120
[   32.696144]  [00000000006bcb24] bus_for_each_dev+0x44/0x80
[   32.761760]  [00000000006bddf8] bus_add_driver+0x198/0x220
[   32.827396]  [00000000006bf7f0] driver_register+0x70/0x120
[   32.893031]  [0000000000427310] do_one_initcall+0x30/0x180
[   32.958669]  [00000000004ab0f0] do_init_module+0x4c/0x1bc
[   33.023251]  [00000000004aa408] load_module+0x1bc8/0x2020
[   33.087843]  [00000000004aa9d4] sys_finit_module+0x74/0xa0
[   33.153481]  [00000000004060b4] linux_sparc_syscall32+0x34/0x60
[   33.224294] ---[ end trace 3332d1d0348bd1b1 ]---
[   33.282263] sr 0:0:6:0: Attached scsi generic sg1 type 5
[   33.499951] ------------[ cut here ]------------
[   33.553491] WARNING: CPU: 0 PID: 513 at ./include/linux/dma-mapping.h:516 snd_dma_alloc_pages+0x180/0x1a0 [snd_pcm]
[   33.678318] Modules linked in: snd_sun_cs4231(+) qlogicpti(+) sunhme sunlance sr_mod(+) snd_pcm parport_sunbpp(+) cdrom parport sg snd_timer snd flash(+) evdev soundcore
[   33.859660] CPU: 0 PID: 513 Comm: udevd Tainted: G        W         4.18.0-12789-gaa5b105 #181
[   33.962781] Call Trace:
[   33.991950]  [00000000100830c0] snd_dma_alloc_pages+0x180/0x1a0 [snd_pcm]
[   34.073225]  [0000000010082838] snd_pcm_lib_preallocate_pages1+0x118/0x1a0 [snd_pcm]
[   34.165966]  [0000000010082918] snd_pcm_lib_preallocate_pages_for_all+0x38/0x80 [snd_pcm]
[   34.263873]  [00000000100c1e38] cs4231_probe+0x638/0x7e0 [snd_sun_cs4231]
[   34.345074]  [00000000006c0b8c] platform_drv_probe+0x2c/0xa0
[   34.412771]  [00000000006be9dc] really_probe+0x19c/0x2e0
[   34.476319]  [00000000006becd0] driver_probe_device+0x50/0x100
[   34.546119]  [00000000006bee74] __driver_attach+0xf4/0x120
[   34.611747]  [00000000006bcb24] bus_for_each_dev+0x44/0x80
[   34.677373]  [00000000006bddf8] bus_add_driver+0x198/0x220
[   34.743010]  [00000000006bf7f0] driver_register+0x70/0x120
[   34.808643]  [0000000000427310] do_one_initcall+0x30/0x180
[   34.874288]  [00000000004ab0f0] do_init_module+0x4c/0x1bc
[   34.938866]  [00000000004aa408] load_module+0x1bc8/0x2020
[   35.003457]  [00000000004aa9d4] sys_finit_module+0x74/0xa0
[   35.069095]  [00000000004060b4] linux_sparc_syscall32+0x34/0x60
[   35.139904] ---[ end trace 3332d1d0348bd1b2 ]---
[   35.286257] sr 0:0:6:0: Attached scsi CD-ROM sr0
[   36.283976] sd 0:0:0:0: [sda] tag#4 FAILED Result: hostbyte=DID_ABORT driverbyte=DRIVER_OK
[   36.381331] sd 0:0:0:0: [sda] tag#4 CDB: ATA command pass through(16) 85 06 20 00 05 00 fe 00 00 00 00 00 00 40 ef 00
[   37.266190] sd 0:0:0:0: [sda] tag#2 FAILED Result: hostbyte=DID_ABORT driverbyte=DRIVER_OK
[   37.363525] sd 0:0:0:0: [sda] tag#2 CDB: ATA command pass through(16) 85 06 20 00 05 00 fe 00 00 00 00 00 00 40 ef 00
[   37.765963] sunlance f006707c rename2: renamed from eth0
[   37.831623] hme f006be34 eth0: renamed from eth1
[   38.320369] (Firmware v1.31.32)
[   38.320401] (FCode 1.21 95/05/18)
[   38.356199] 
               qlogicpti0: [Fast Wide, using single ended interface]
[   38.486325] scsi host2: PTI Qlogic,ISP SBUS SCSI irq 15 regs at (____ptrval____)
[   38.736044] sd 0:0:0:0: [sda] tag#1 FAILED Result: hostbyte=DID_ABORT driverbyte=DRIVER_OK
[   38.833349] sd 0:0:0:0: [sda] tag#1 CDB: ATA command pass through(16) 85 06 20 00 05 00 fe 00 00 00 00 00 00 40 ef 00
[   38.994170] systemd-udevd[519]: renamed network interface eth1 to eth0
[   39.100116] systemd-udevd[516]: renamed network interface eth0 to rename2
[   39.266082] sd 0:0:0:0: [sda] tag#1 FAILED Result: hostbyte=DID_ABORT driverbyte=DRIVER_OK
[   39.363408] sd 0:0:0:0: [sda] tag#1 CDB: ATA command pass through(16) 85 06 20 00 05 00 fe 00 00 00 00 00 00 40 ef 00
[   39.605965] sd 0:0:0:0: [sda] tag#1 FAILED Result: hostbyte=DID_ABORT driverbyte=DRIVER_OK
[   39.703275] sd 0:0:0:0: [sda] tag#1 CDB: ATA command pass through(16) 85 06 20 00 05 00 fe 00 00 00 00 00 00 40 ef 00
[   39.916597] sunlance f006707c eth1: renamed from rename2
[   40.119269] systemd-udevd[516]: renamed network interface eth0 to eth1
[   41.033237] Adding 360440k swap on /dev/sda4.  Priority:-2 extents:1 across:360440k 
[   41.441029] EXT4-fs (sda2): re-mounted. Opts: (null)
[   42.110875] EXT4-fs (sda2): re-mounted. Opts: errors=remount-ro
[   47.809743] NET: Registered protocol family 10
[   47.868327] Segment Routing with IPv6
[   49.196386] EXT4-fs (sda1): mounting ext3 file system using the ext4 subsystem
[   49.298784] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
[   54.513618] random: dd: uninitialized urandom read (512 bytes read)
[   59.720440] eth0: Link is up using 
[   59.720459] internal 
[   59.760188] transceiver at 
[   59.787280] 100Mb/s, Full Duplex.
[   64.259942] random: crng init done

-- 
Meelis Roos (mroos-Y27EyoLml9s@public.gmane.org)

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: new SBus related DMA warnings in 4.18+git
       [not found] ` <alpine.LRH.2.21.1808260902280.22219-ptEonEWSGqKptlylMvRsHA@public.gmane.org>
@ 2018-08-27 15:47     ` Christoph Hellwig
  0 siblings, 0 replies; 22+ messages in thread
From: Christoph Hellwig @ 2018-08-27 15:47 UTC (permalink / raw)
  To: Meelis Roos
  Cc: sparclinux-u79uwXL29TY76Z2rM5mHXA,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	Christoph Hellwig

On Sun, Aug 26, 2018 at 10:48:44AM +0300, Meelis Roos wrote:
> Tried yesterdays git 4.18.0-12789-gaa5b105 on a Sun Ultra 1 with SBus 
> and several SBus connected devicess give DMA mapping related warnings:

This should have been around since the warning was added.

The patch below should fix it:

---
From 6294e0e330851ee06e66ab85b348f1d92d375d7a Mon Sep 17 00:00:00 2001
From: Christoph Hellwig <hch@lst.de>
Date: Mon, 27 Aug 2018 17:23:24 +0200
Subject: driver core: initialize a default DMA mask for platform device

We still treat devices without a DMA mask as defaulting to 32-bits for
both mask, but a few releases ago we've started warning about such
cases, as they require special cases to work around this sloppyness.
Add a dma_mask field to struct platform_object so that we can initialize
the dma_mask pointer in struct device and initialize both masks to
32-bits by default.  Architectures can still override this in
arch_setup_pdev_archdata if needed.

Note that the code looks a little odd with the various conditionals
because we have to support platform_device structures that are
statically allocated.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/base/platform.c         | 15 +++++++++++++--
 include/linux/platform_device.h |  1 +
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index dff82a3c2caa..baf4b06cf2d9 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -225,6 +225,17 @@ struct platform_object {
 	char name[];
 };
 
+static void setup_pdev_archdata(struct platform_device *pdev)
+{
+	if (!pdev->dev.coherent_dma_mask)
+		pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
+	if (!pdev->dma_mask)
+		pdev->dma_mask = DMA_BIT_MASK(32);
+	if (!pdev->dev.dma_mask)
+		pdev->dev.dma_mask = &pdev->dma_mask;
+	arch_setup_pdev_archdata(pdev);
+};
+
 /**
  * platform_device_put - destroy a platform device
  * @pdev: platform device to free
@@ -271,7 +282,7 @@ struct platform_device *platform_device_alloc(const char *name, int id)
 		pa->pdev.id = id;
 		device_initialize(&pa->pdev.dev);
 		pa->pdev.dev.release = platform_device_release;
-		arch_setup_pdev_archdata(&pa->pdev);
+		setup_pdev_archdata(&pa->pdev);
 	}
 
 	return pa ? &pa->pdev : NULL;
@@ -472,7 +483,7 @@ EXPORT_SYMBOL_GPL(platform_device_del);
 int platform_device_register(struct platform_device *pdev)
 {
 	device_initialize(&pdev->dev);
-	arch_setup_pdev_archdata(pdev);
+	setup_pdev_archdata(pdev);
 	return platform_device_add(pdev);
 }
 EXPORT_SYMBOL_GPL(platform_device_register);
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index 1a9f38f27f65..d84ec1de6022 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -25,6 +25,7 @@ struct platform_device {
 	int		id;
 	bool		id_auto;
 	struct device	dev;
+	dma_addr_t	dma_mask;
 	u32		num_resources;
 	struct resource	*resource;
 
-- 
2.18.0

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Re: new SBus related DMA warnings in 4.18+git
@ 2018-08-27 15:47     ` Christoph Hellwig
  0 siblings, 0 replies; 22+ messages in thread
From: Christoph Hellwig @ 2018-08-27 15:47 UTC (permalink / raw)
  To: Meelis Roos
  Cc: sparclinux-u79uwXL29TY76Z2rM5mHXA,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	Christoph Hellwig

On Sun, Aug 26, 2018 at 10:48:44AM +0300, Meelis Roos wrote:
> Tried yesterdays git 4.18.0-12789-gaa5b105 on a Sun Ultra 1 with SBus 
> and several SBus connected devicess give DMA mapping related warnings:

This should have been around since the warning was added.

The patch below should fix it:

---
>From 6294e0e330851ee06e66ab85b348f1d92d375d7a Mon Sep 17 00:00:00 2001
From: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
Date: Mon, 27 Aug 2018 17:23:24 +0200
Subject: driver core: initialize a default DMA mask for platform device

We still treat devices without a DMA mask as defaulting to 32-bits for
both mask, but a few releases ago we've started warning about such
cases, as they require special cases to work around this sloppyness.
Add a dma_mask field to struct platform_object so that we can initialize
the dma_mask pointer in struct device and initialize both masks to
32-bits by default.  Architectures can still override this in
arch_setup_pdev_archdata if needed.

Note that the code looks a little odd with the various conditionals
because we have to support platform_device structures that are
statically allocated.

Signed-off-by: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
---
 drivers/base/platform.c         | 15 +++++++++++++--
 include/linux/platform_device.h |  1 +
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index dff82a3c2caa..baf4b06cf2d9 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -225,6 +225,17 @@ struct platform_object {
 	char name[];
 };
 
+static void setup_pdev_archdata(struct platform_device *pdev)
+{
+	if (!pdev->dev.coherent_dma_mask)
+		pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
+	if (!pdev->dma_mask)
+		pdev->dma_mask = DMA_BIT_MASK(32);
+	if (!pdev->dev.dma_mask)
+		pdev->dev.dma_mask = &pdev->dma_mask;
+	arch_setup_pdev_archdata(pdev);
+};
+
 /**
  * platform_device_put - destroy a platform device
  * @pdev: platform device to free
@@ -271,7 +282,7 @@ struct platform_device *platform_device_alloc(const char *name, int id)
 		pa->pdev.id = id;
 		device_initialize(&pa->pdev.dev);
 		pa->pdev.dev.release = platform_device_release;
-		arch_setup_pdev_archdata(&pa->pdev);
+		setup_pdev_archdata(&pa->pdev);
 	}
 
 	return pa ? &pa->pdev : NULL;
@@ -472,7 +483,7 @@ EXPORT_SYMBOL_GPL(platform_device_del);
 int platform_device_register(struct platform_device *pdev)
 {
 	device_initialize(&pdev->dev);
-	arch_setup_pdev_archdata(pdev);
+	setup_pdev_archdata(pdev);
 	return platform_device_add(pdev);
 }
 EXPORT_SYMBOL_GPL(platform_device_register);
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index 1a9f38f27f65..d84ec1de6022 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -25,6 +25,7 @@ struct platform_device {
 	int		id;
 	bool		id_auto;
 	struct device	dev;
+	dma_addr_t	dma_mask;
 	u32		num_resources;
 	struct resource	*resource;
 
-- 
2.18.0

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Re: new SBus related DMA warnings in 4.18+git
       [not found]     ` <20180827154716.GA30492-jcswGhMUV9g@public.gmane.org>
@ 2018-08-27 19:04         ` Meelis Roos
  2018-08-27 19:15         ` Sam Ravnborg
  1 sibling, 0 replies; 22+ messages in thread
From: Meelis Roos @ 2018-08-27 19:04 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: sparclinux-u79uwXL29TY76Z2rM5mHXA,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA

> On Sun, Aug 26, 2018 at 10:48:44AM +0300, Meelis Roos wrote:
> > Tried yesterdays git 4.18.0-12789-gaa5b105 on a Sun Ultra 1 with SBus 
> > and several SBus connected devicess give DMA mapping related warnings:
> 
> This should have been around since the warning was added.
> 
> The patch below should fix it:
> 
> ---
> >From 6294e0e330851ee06e66ab85b348f1d92d375d7a Mon Sep 17 00:00:00 2001
> From: Christoph Hellwig <hch@lst.de>
> Date: Mon, 27 Aug 2018 17:23:24 +0200
> Subject: driver core: initialize a default DMA mask for platform device

No, it does not fix it. Dmesg from another SBus machine that conmpiled 
it faster (Sun Ultra 2):

[    0.000112] PROMLIB: Sun IEEE Boot Prom 'OBP 3.25.0 1999/12/03 11:35'
[    0.000131] PROMLIB: Root node compatible: 
[    0.000250] Linux version 4.18.0-12952-g2923b27-dirty (mroos@u2) (gcc version 4.9.3 (Debian 4.9.3-2)) #239 SMP Mon Aug 27 21:42:14 EEST 2018
[    0.000448] debug: ignoring loglevel setting.
[    0.329860] bootconsole [earlyprom0] enabled
[    0.380881] ARCH: SUN4U
[    0.410167] Ethernet address: 08:00:20:89:2a:a0
[    0.464243] MM: PAGE_OFFSET is 0xfffff80000000000 (max_phys_bits = 40)
[    0.543372] MM: VMALLOC [0x0000000100000000 --> 0x0000060000000000]
[    0.618366] MM: VMEMMAP [0x0000060000000000 --> 0x00000c0000000000]
[    0.697932] Kernel: Using 2 locked TLB entries for main kernel image.
[    0.774140] Remapping the kernel... 
[    0.807146] done.
[    1.154827] OF stdout device is: /sbus@1f,0/zs@f,1100000:a
[    1.219566] PROM: Built device tree with 63364 bytes of memory.
[    1.290510] Top of RAM: 0x6ff2c000, Total RAM: 0x37f1a000
[    1.354970] Memory hole size: 896MB
[    1.406349] Allocated 16384 bytes for kernel page tables.
[    1.470133] Zone ranges:
[    1.500269]   Normal   [mem 0x0000000000000000-0x000000006ff2bfff]
[    1.574219] Movable zone start for each node
[    1.625258] Early memory node ranges
[    1.667967]   node   0: [mem 0x0000000000000000-0x000000000fffffff]
[    1.742961]   node   0: [mem 0x0000000020000000-0x0000000027ffffff]
[    1.817956]   node   0: [mem 0x0000000040000000-0x000000004fffffff]
[    1.892948]   node   0: [mem 0x0000000060000000-0x000000006fefdfff]
[    1.967942]   node   0: [mem 0x000000006ff00000-0x000000006ff05fff]
[    2.042936]   node   0: [mem 0x000000006ff16000-0x000000006ff2bfff]
[    2.118044] Initmem setup node 0 [mem 0x0000000000000000-0x000000006ff2bfff]
[    2.202302] On node 0 totalpages: 114573
[    2.249169]   Normal zone: 896 pages used for memmap
[    2.308537]   Normal zone: 0 pages reserved
[    2.358535]   Normal zone: 114573 pages, LIFO batch:31
[    2.495241] Booting Linux...
[    2.528734] CPU CAPS: [flush,stbar,swap,muldiv,v9,mul32,div32,v8plus]
[    2.605799] CPU CAPS: [vis]
[    2.668258] percpu: Embedded 10 pages/cpu @(____ptrval____) s44928 r8192 d28800 u2097152
[    2.766410] pcpu-alloc: s44928 r8192 d28800 u2097152 alloc=1*4194304
[    2.841510] pcpu-alloc: [0] 0 1 
[    2.885668] Built 1 zonelists, mobility grouping on.  Total pages: 113677
[    2.965990] Kernel command line: root=/dev/sda2 ro ignore_loglevel
[    3.046466] Dentry cache hash table entries: 131072 (order: 7, 1048576 bytes)
[    3.134227] Inode-cache hash table entries: 65536 (order: 6, 524288 bytes)
[    3.215649] Sorting __ex_table...
[    3.310465] Memory: 892040K/916584K available (4329K kernel code, 255K rwdata, 816K rodata, 232K init, 268K bss, 24544K reserved, 0K cma-reserved)
[    3.467295] SLUB: HWalign2, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[    3.545872] rcu: Hierarchical RCU implementation.
[    3.601352] NR_IRQS: 2048, nr_irqs: 2048, preallocated irqs: 1
[    3.671504] clocksource: tick: mask: 0xffffffffffffffff max_cycles: 0x44439c2a93, max_idle_ns: 440795210626 ns
[    3.790815] clocksource: mult[360e5ba] shift[24]
[    3.846017] clockevent: mult[4bc5ed4a] shift[32]
[    3.901587] Console: colour dummy device 80x25
[    3.954414] console [tty0] enabled
[    3.994980] bootconsole [earlyprom0] disabled
[    4.197213] Calibrating delay using timer specific routine.. 593.26 BogoMIPS (lpj)66300)
[    4.197267] pid_max: default: 32768 minimum: 301
[    4.197757] Mount-cache hash table entries: 2048 (order: 1, 16384 bytes)
[    4.197861] Mountpoint-cache hash table entries: 2048 (order: 1, 16384 bytes)
[    4.201878] rcu: Hierarchical SRCU implementation.
[    4.203657] smp: Bringing up secondary CPUs ...
[    4.237851] CPU 1: synchronized TICK with master CPU (last diff -17 cycles, maxerr 539 cycles)
[    4.238252] smp: Brought up 1 node, 2 CPUs
[    4.239996] devtmpfs: initialized
[    4.245228] random: get_random_u32 called from bucket_table_alloc.isra.18+0x7c/0x1c0 with crng_init=0
[    4.245850] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    4.245913] futex hash table entries: 512 (order: 2, 32768 bytes)
[    4.247101] NET: Registered protocol family 16
[    4.261051] SYSIO: UPA portID ffffffff, at 000001fe00000000
[    4.297680] HugeTLB registered 64.0 KiB page size, pre-allocated 0 pages
[    4.297744] HugeTLB registered 8.00 MiB page size, pre-allocated 0 pages
[    4.297779] HugeTLB registered 256 MiB page size, pre-allocated 0 pages
[    4.297816] HugeTLB registered 2.00 GiB page size, pre-allocated 0 pages
[    4.300832] fbcon: Taking over console
[    4.301679] SCSI subsystem initialized
[    4.304283] mostek f005b464: DMA mask not set
[    4.304365] /sbus@1f,0/eeprom@f,1200000: Mostek regs at 0x1fff1200000
[    4.305251] auxio f005b1d8: DMA mask not set
[    4.305332] AUXIO: Found device at /sbus@1f,0/auxio@f,1900000
[    4.305771] clocksource: Switched to clocksource tick
[    4.340181] NET: Registered protocol family 2
[    4.342138] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 8192 bytes)
[    4.342268] TCP established hash table entries: 8192 (order: 3, 65536 bytes)
[    4.342661] TCP bind hash table entries: 8192 (order: 4, 131072 bytes)
[    4.343354] TCP: Hash tables configured (established 8192 bind 8192)
[    4.343785] UDP hash table entries: 512 (order: 1, 16384 bytes)
[    4.343961] UDP-Lite hash table entries: 512 (order: 1, 16384 bytes)
[    4.344447] NET: Registered protocol family 1
[    4.349437] workingset: timestamp_bitsb max_order\x17 bucket_order=0
[    4.392958] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 253)
[    4.393060] io scheduler noop registered
[    4.393099] io scheduler deadline registered
[    4.393471] io scheduler cfq registered (default)
[    4.394406] ffb f006635c: DMA mask not set
[    4.396369] Console: switching to colour frame buffer device 144x56
[    4.407269] /SUNW,ffb@1e,0: FFB at 000001fc00000000, type 8, DAC pnum[236c] rev[10] manuf_rev[4]
[    4.407893] cg6 f00930e0: DMA mask not set
[    4.408983] /sbus@1f,0/cgsix@1,0: CGsix [TGX sparc] at 0:1ff10000000
[    4.410748] zs f005b518: DMA mask not set
[    4.411208] f005b518: ttyS0 at MMIO 0x1fff1100000 (irq = 9, base_baud = 307200) is a zs
[    4.411375] Console: ttyS0 (SunZilog zs0)
[   11.168494] console [ttyS0] enabled
[   11.210705] f005b518: ttyS1 at MMIO 0x1fff1100004 (irq = 9, base_baud = 307200) is a zs
[   11.306714] zs f005c9b8: DMA mask not set
[   11.354326] f005c9b8: Keyboard at MMIO 0x1fff1000000 (irq = 9) is a zs
[   11.432125] f005c9b8: Mouse at MMIO 0x1fff1000004 (irq = 9) is a zs
[   11.508108] esp f006c230: DMA mask not set
[   11.557107] ------------[ cut here ]------------
[   11.611290] WARNING: CPU: 0 PID: 1 at ./include/linux/dma-mapping.h:516 esp_sbus_probe+0x57c/0x700
[   11.718646] Modules linked in:
[   11.754977] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.18.0-12952-g2923b27-dirty #239
[   11.849770] Call Trace:
[   11.878854]  [0000000000457af0] __warn+0xb0/0xe0
[   11.934092]  [000000000071d47c] esp_sbus_probe+0x57c/0x700
[   11.999738]  [00000000006f07cc] platform_drv_probe+0x2c/0xa0
[   12.067422]  [00000000006ee9fc] really_probe+0x19c/0x2e0
[   12.130953]  [00000000006eef10] driver_probe_device+0x50/0x100
[   12.200750]  [00000000006ef0b4] __driver_attach+0xf4/0x120
[   12.266361]  [00000000006ecbc4] bus_for_each_dev+0x44/0x80
[   12.331980]  [00000000006edc18] bus_add_driver+0x198/0x220
[   12.397605]  [00000000006efb10] driver_register+0x70/0x120
[   12.463229]  [0000000000427310] do_one_initcall+0x30/0x180
[   12.528857]  [0000000000954b2c] kernel_init_freeable+0x148/0x1e4
[   12.600737]  [0000000000838124] kernel_init+0x4/0x120
[   12.661120]  [0000000000406064] ret_from_fork+0x1c/0x2c
[   12.723604]  [0000000000000000]           (null)
[   12.782988] ---[ end trace 0d4c52020aafc2d4 ]---
[   12.841032] esp f006c230: esp0: regs[(____ptrval____):(____ptrval____)] irq[10]
[   12.930780] esp f006c230: esp0: is a FASHME, 40 MHz (ccf=0), SCSI ID 7
[   16.097212] scsi host0: esp
[   16.135602] scsi 0:0:0:0: Direct-Access     FUJITSU  MAP3367N SUN36G  0401 PQ: 0 ANSI: 4
[   16.235036] scsi target0:0:0: Beginning Domain Validation
[   16.307457] scsi target0:0:0: FAST-10 WIDE SCSI 20.0 MB/s ST (100 ns, offset 15)
[   16.399928] scsi target0:0:0: Domain Validation skipping write tests
[   16.478336] scsi target0:0:0: Ending Domain Validation
[   17.721196] scsi 0:0:6:0: CD-ROM            NEC      CD-ROM DRIVE:463 1.05 PQ: 0 ANSI: 2
[   17.820629] scsi target0:0:6: Beginning Domain Validation
[   17.891527] scsi target0:0:6: FAST-10 SCSI 10.0 MB/s ST (100 ns, offset 15)
[   17.979824] scsi target0:0:6: Domain Validation skipping write tests
[   18.058282] scsi target0:0:6: Ending Domain Validation
[   20.000261] sd 0:0:0:0: Power-on or device reset occurred
[   20.067471] mousedev: PS/2 mouse device common for all mice
[   20.138372] rtc-m48t59 rtc-m48t59.0: registered as rtc0
[   20.204324] NET: Registered protocol family 17
[   20.255650] sd 0:0:0:0: [sda] 71132959 512-byte logical blocks: (36.4 GB/33.9 GiB)
[   20.259821] Key type dns_resolver registered
[   20.407848] rtc-m48t59 rtc-m48t59.0: setting system clock to 2018-08-27 18:49:51 UTC (1535395791)
[   20.516793] sd 0:0:0:0: [sda] Write Protect is off
[   20.576704] sd 0:0:0:0: [sda] Mode Sense: b3 00 00 08
[   20.641255] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[   20.769811]  sda: sda1 sda2 sda3 sda4
[   20.823985] sd 0:0:0:0: [sda] Attached SCSI disk
[   21.218313] input: Sun Mouse as /devices/root/f005abc8/f005c9b8/serio1/input/input1
[   21.325293] random: fast init done
[   21.396507] EXT4-fs (sda2): mounted filesystem with ordered data mode. Opts: (null)
[   21.490805] VFS: Mounted root (ext4 filesystem) readonly on device 8:2.
[   21.596389] devtmpfs: mounted
[   21.635446] This architecture does not have kernel memory protection.
[   21.715165] Run /sbin/init as init process
[   24.104249] random: udevd: uninitialized urandom read (16 bytes read)
[   24.188187] random: udevd: uninitialized urandom read (16 bytes read)
[   24.269361] random: udevd: uninitialized urandom read (16 bytes read)
[   24.838696] flash f005b268: DMA mask not set
[   24.892363] /sbus@1f,0/flashprom@f,0: OBP Flash, RD 1fff0000000[80000] WR 1fff1380000[80000]
[   25.029284] hme f007280c: DMA mask not set
[   25.082398] sunhme.c:v3.10 August 26, 2008 David S. Miller (davem@davemloft.net)
[   25.173398] ------------[ cut here ]------------
[   25.231068] WARNING: CPU: 0 PID: 594 at ./include/linux/dma-mapping.h:516 happy_meal_sbus_probe_one+0x7a8/0x8c0 [sunhme]
[   25.363817] Modules linked in: sunhme(+) soundcore flash
[   25.429833] CPU: 0 PID: 594 Comm: udevd Tainted: G        W         4.18.0-12952-g2923b27-dirty #239
[   25.541685] Call Trace:
[   25.573303]  [0000000000457af0] __warn+0xb0/0xe0
[   25.631011]  [0000000010012828] happy_meal_sbus_probe_one+0x7a8/0x8c0 [sunhme]
[   25.720023]  [00000000006f07cc] platform_drv_probe+0x2c/0xa0
[   25.790310]  [00000000006ee9fc] really_probe+0x19c/0x2e0
[   25.856351]  [00000000006eef10] driver_probe_device+0x50/0x100
[   25.928639]  [00000000006ef0b4] __driver_attach+0xf4/0x120
[   25.996762]  [00000000006ecbc4] bus_for_each_dev+0x44/0x80
[   26.064887]  [00000000006edc18] bus_add_driver+0x198/0x220
[   26.133128]  [00000000006efb10] driver_register+0x70/0x120
[   26.201344]  [0000000010018010] happy_meal_probe+0x10/0xc0 [sunhme]
[   26.278959]  [0000000000427310] do_one_initcall+0x30/0x180
[   26.347181]  [00000000004cb4e8] do_init_module+0x4c/0x1c4
[   26.414307]  [00000000004ca428] load_module+0x11c8/0x1260
[   26.481388]  [00000000004ca634] sys_finit_module+0x74/0xa0
[   26.549474]  [00000000004061b4] linux_sparc_syscall32+0x34/0x60
[   26.622824] ---[ end trace 0d4c52020aafc2d6 ]---
[   26.682802] eth0: HAPPY MEAL (SBUS) 10/100baseT Ethernet 
[   26.682813] 08:00:20:89:2a:a0
[   26.787983] hme f007a418: DMA mask not set
[   26.847151] sd 0:0:0:0: Attached scsi generic sg0 type 0
[   26.910437] eth1: Quattro HME slot 0 (SBUS) 10/100baseT Ethernet 
[   26.913242] 08:00:20:cc:93:40
[   27.028194] hme f00803cc: DMA mask not set
[   27.082052] eth2: Quattro HME slot 1 (SBUS) 10/100baseT Ethernet 
[   27.082063] 08:00:20:cc:93:41
[   27.190917] bpp f007a25c: DMA mask not set
[   27.195172] hme f00862a8: DMA mask not set
[   27.293628] parport0: sunbpp at 0x1ffec800000
[   27.300035] eth3: Quattro HME slot 2 (SBUS) 10/100baseT Ethernet 
[   27.352282] 08:00:20:cc:93:42
[   27.465580] hme f008c9c4: DMA mask not set
[   27.520730] eth4: Quattro HME slot 3 (SBUS) 10/100baseT Ethernet 
[   27.520740] 08:00:20:cc:93:43
[   27.642120] scsi 0:0:6:0: Attached scsi generic sg1 type 5
[   27.711314] sr 0:0:6:0: Power-on or device reset occurred
[   27.784509] sr 0:0:6:0: [sr0] scsi-1 drive
[   27.837306] cdrom: Uniform CD-ROM driver Revision: 3.20
[   27.914630] audio f005b0cc: DMA mask not set
[   27.980828] sr 0:0:6:0: Attached scsi CD-ROM sr0
[   28.158845] ------------[ cut here ]------------
[   28.216326] WARNING: CPU: 1 PID: 580 at ./include/linux/dma-mapping.h:516 snd_dma_alloc_pages+0x180/0x1a0 [snd_pcm]
[   28.343408] Modules linked in: snd_sun_cs4231(+) sr_mod cdrom parport_sunbpp snd_pcm evdev parport snd_timer sg snd sunhme soundcore flash
[   28.494661] CPU: 1 PID: 580 Comm: udevd Tainted: G        W         4.18.0-12952-g2923b27-dirty #239
[   28.606119] Call Trace:
[   28.637303]  [0000000000457af0] __warn+0xb0/0xe0
[   28.694687]  [00000000100a91a0] snd_dma_alloc_pages+0x180/0x1a0 [snd_pcm]
[   28.778220]  [00000000100a8918] snd_pcm_lib_preallocate_pages1+0x118/0x1a0 [snd_pcm]
[   28.873222]  [00000000100a89d8] snd_pcm_lib_preallocate_pages_for_all+0x38/0x80 [snd_pcm]
[   28.973388]  [00000000100dbf18] cs4231_probe+0x678/0x820 [snd_sun_cs4231]
[   29.056744]  [00000000006f07cc] platform_drv_probe+0x2c/0xa0
[   29.126586]  [00000000006ee9fc] really_probe+0x19c/0x2e0
[   29.192167]  [00000000006eef10] driver_probe_device+0x50/0x100
[   29.263973]  [00000000006ef0b4] __driver_attach+0xf4/0x120
[   29.331480]  [00000000006ecbc4] bus_for_each_dev+0x44/0x80
[   29.398927]  [00000000006edc18] bus_add_driver+0x198/0x220
[   29.466364]  [00000000006efb10] driver_register+0x70/0x120
[   29.533766]  [0000000000427310] do_one_initcall+0x30/0x180
[   29.601227]  [00000000004cb4e8] do_init_module+0x4c/0x1c4
[   29.667536]  [00000000004ca428] load_module+0x11c8/0x1260
[   29.733883]  [00000000004ca634] sys_finit_module+0x74/0xa0
[   29.801342] ---[ end trace 0d4c52020aafc2d7 ]---
[   31.012131] random: crng init done
[   31.054663] random: 1 urandom warning(s) missed due to ratelimiting
[   31.441800] Adding 722912k swap on /dev/sda4.  Priority:-2 extents:1 across:722912k 
[   31.720740] EXT4-fs (sda2): re-mounted. Opts: (null)
[   32.176380] EXT4-fs (sda2): re-mounted. Opts: errors=remount-ro
[   34.126095] loop: module loaded
[   34.679947] EXT4-fs (sda1): mounting ext2 file system using the ext4 subsystem
[   34.788477] EXT4-fs (sda1): mounted filesystem without journal. Opts: (null)
[   37.302565] NET: Registered protocol family 10
[   37.362653] Segment Routing with IPv6
[   41.620058] eth0: Link is up using 
[   41.620074] internal 
[   41.663868] transceiver at 
[   41.692882] 100Mb/s, Full Duplex.

-- 
Meelis Roos (mroos@linux.ee)

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: new SBus related DMA warnings in 4.18+git
@ 2018-08-27 19:04         ` Meelis Roos
  0 siblings, 0 replies; 22+ messages in thread
From: Meelis Roos @ 2018-08-27 19:04 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: sparclinux-u79uwXL29TY76Z2rM5mHXA,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA

> On Sun, Aug 26, 2018 at 10:48:44AM +0300, Meelis Roos wrote:
> > Tried yesterdays git 4.18.0-12789-gaa5b105 on a Sun Ultra 1 with SBus 
> > and several SBus connected devicess give DMA mapping related warnings:
> 
> This should have been around since the warning was added.
> 
> The patch below should fix it:
> 
> ---
> >From 6294e0e330851ee06e66ab85b348f1d92d375d7a Mon Sep 17 00:00:00 2001
> From: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
> Date: Mon, 27 Aug 2018 17:23:24 +0200
> Subject: driver core: initialize a default DMA mask for platform device

No, it does not fix it. Dmesg from another SBus machine that conmpiled 
it faster (Sun Ultra 2):

[    0.000112] PROMLIB: Sun IEEE Boot Prom 'OBP 3.25.0 1999/12/03 11:35'
[    0.000131] PROMLIB: Root node compatible: 
[    0.000250] Linux version 4.18.0-12952-g2923b27-dirty (mroos@u2) (gcc version 4.9.3 (Debian 4.9.3-2)) #239 SMP Mon Aug 27 21:42:14 EEST 2018
[    0.000448] debug: ignoring loglevel setting.
[    0.329860] bootconsole [earlyprom0] enabled
[    0.380881] ARCH: SUN4U
[    0.410167] Ethernet address: 08:00:20:89:2a:a0
[    0.464243] MM: PAGE_OFFSET is 0xfffff80000000000 (max_phys_bits == 40)
[    0.543372] MM: VMALLOC [0x0000000100000000 --> 0x0000060000000000]
[    0.618366] MM: VMEMMAP [0x0000060000000000 --> 0x00000c0000000000]
[    0.697932] Kernel: Using 2 locked TLB entries for main kernel image.
[    0.774140] Remapping the kernel... 
[    0.807146] done.
[    1.154827] OF stdout device is: /sbus@1f,0/zs@f,1100000:a
[    1.219566] PROM: Built device tree with 63364 bytes of memory.
[    1.290510] Top of RAM: 0x6ff2c000, Total RAM: 0x37f1a000
[    1.354970] Memory hole size: 896MB
[    1.406349] Allocated 16384 bytes for kernel page tables.
[    1.470133] Zone ranges:
[    1.500269]   Normal   [mem 0x0000000000000000-0x000000006ff2bfff]
[    1.574219] Movable zone start for each node
[    1.625258] Early memory node ranges
[    1.667967]   node   0: [mem 0x0000000000000000-0x000000000fffffff]
[    1.742961]   node   0: [mem 0x0000000020000000-0x0000000027ffffff]
[    1.817956]   node   0: [mem 0x0000000040000000-0x000000004fffffff]
[    1.892948]   node   0: [mem 0x0000000060000000-0x000000006fefdfff]
[    1.967942]   node   0: [mem 0x000000006ff00000-0x000000006ff05fff]
[    2.042936]   node   0: [mem 0x000000006ff16000-0x000000006ff2bfff]
[    2.118044] Initmem setup node 0 [mem 0x0000000000000000-0x000000006ff2bfff]
[    2.202302] On node 0 totalpages: 114573
[    2.249169]   Normal zone: 896 pages used for memmap
[    2.308537]   Normal zone: 0 pages reserved
[    2.358535]   Normal zone: 114573 pages, LIFO batch:31
[    2.495241] Booting Linux...
[    2.528734] CPU CAPS: [flush,stbar,swap,muldiv,v9,mul32,div32,v8plus]
[    2.605799] CPU CAPS: [vis]
[    2.668258] percpu: Embedded 10 pages/cpu @(____ptrval____) s44928 r8192 d28800 u2097152
[    2.766410] pcpu-alloc: s44928 r8192 d28800 u2097152 alloc=1*4194304
[    2.841510] pcpu-alloc: [0] 0 1 
[    2.885668] Built 1 zonelists, mobility grouping on.  Total pages: 113677
[    2.965990] Kernel command line: root=/dev/sda2 ro ignore_loglevel
[    3.046466] Dentry cache hash table entries: 131072 (order: 7, 1048576 bytes)
[    3.134227] Inode-cache hash table entries: 65536 (order: 6, 524288 bytes)
[    3.215649] Sorting __ex_table...
[    3.310465] Memory: 892040K/916584K available (4329K kernel code, 255K rwdata, 816K rodata, 232K init, 268K bss, 24544K reserved, 0K cma-reserved)
[    3.467295] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[    3.545872] rcu: Hierarchical RCU implementation.
[    3.601352] NR_IRQS: 2048, nr_irqs: 2048, preallocated irqs: 1
[    3.671504] clocksource: tick: mask: 0xffffffffffffffff max_cycles: 0x44439c2a93, max_idle_ns: 440795210626 ns
[    3.790815] clocksource: mult[360e5ba] shift[24]
[    3.846017] clockevent: mult[4bc5ed4a] shift[32]
[    3.901587] Console: colour dummy device 80x25
[    3.954414] console [tty0] enabled
[    3.994980] bootconsole [earlyprom0] disabled
[    4.197213] Calibrating delay using timer specific routine.. 593.26 BogoMIPS (lpj=2966300)
[    4.197267] pid_max: default: 32768 minimum: 301
[    4.197757] Mount-cache hash table entries: 2048 (order: 1, 16384 bytes)
[    4.197861] Mountpoint-cache hash table entries: 2048 (order: 1, 16384 bytes)
[    4.201878] rcu: Hierarchical SRCU implementation.
[    4.203657] smp: Bringing up secondary CPUs ...
[    4.237851] CPU 1: synchronized TICK with master CPU (last diff -17 cycles, maxerr 539 cycles)
[    4.238252] smp: Brought up 1 node, 2 CPUs
[    4.239996] devtmpfs: initialized
[    4.245228] random: get_random_u32 called from bucket_table_alloc.isra.18+0x7c/0x1c0 with crng_init=0
[    4.245850] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    4.245913] futex hash table entries: 512 (order: 2, 32768 bytes)
[    4.247101] NET: Registered protocol family 16
[    4.261051] SYSIO: UPA portID ffffffff, at 000001fe00000000
[    4.297680] HugeTLB registered 64.0 KiB page size, pre-allocated 0 pages
[    4.297744] HugeTLB registered 8.00 MiB page size, pre-allocated 0 pages
[    4.297779] HugeTLB registered 256 MiB page size, pre-allocated 0 pages
[    4.297816] HugeTLB registered 2.00 GiB page size, pre-allocated 0 pages
[    4.300832] fbcon: Taking over console
[    4.301679] SCSI subsystem initialized
[    4.304283] mostek f005b464: DMA mask not set
[    4.304365] /sbus@1f,0/eeprom@f,1200000: Mostek regs at 0x1fff1200000
[    4.305251] auxio f005b1d8: DMA mask not set
[    4.305332] AUXIO: Found device at /sbus@1f,0/auxio@f,1900000
[    4.305771] clocksource: Switched to clocksource tick
[    4.340181] NET: Registered protocol family 2
[    4.342138] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 8192 bytes)
[    4.342268] TCP established hash table entries: 8192 (order: 3, 65536 bytes)
[    4.342661] TCP bind hash table entries: 8192 (order: 4, 131072 bytes)
[    4.343354] TCP: Hash tables configured (established 8192 bind 8192)
[    4.343785] UDP hash table entries: 512 (order: 1, 16384 bytes)
[    4.343961] UDP-Lite hash table entries: 512 (order: 1, 16384 bytes)
[    4.344447] NET: Registered protocol family 1
[    4.349437] workingset: timestamp_bits=62 max_order=17 bucket_order=0
[    4.392958] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 253)
[    4.393060] io scheduler noop registered
[    4.393099] io scheduler deadline registered
[    4.393471] io scheduler cfq registered (default)
[    4.394406] ffb f006635c: DMA mask not set
[    4.396369] Console: switching to colour frame buffer device 144x56
[    4.407269] /SUNW,ffb@1e,0: FFB at 000001fc00000000, type 8, DAC pnum[236c] rev[10] manuf_rev[4]
[    4.407893] cg6 f00930e0: DMA mask not set
[    4.408983] /sbus@1f,0/cgsix@1,0: CGsix [TGX sparc] at 0:1ff10000000
[    4.410748] zs f005b518: DMA mask not set
[    4.411208] f005b518: ttyS0 at MMIO 0x1fff1100000 (irq = 9, base_baud = 307200) is a zs
[    4.411375] Console: ttyS0 (SunZilog zs0)
[   11.168494] console [ttyS0] enabled
[   11.210705] f005b518: ttyS1 at MMIO 0x1fff1100004 (irq = 9, base_baud = 307200) is a zs
[   11.306714] zs f005c9b8: DMA mask not set
[   11.354326] f005c9b8: Keyboard at MMIO 0x1fff1000000 (irq = 9) is a zs
[   11.432125] f005c9b8: Mouse at MMIO 0x1fff1000004 (irq = 9) is a zs
[   11.508108] esp f006c230: DMA mask not set
[   11.557107] ------------[ cut here ]------------
[   11.611290] WARNING: CPU: 0 PID: 1 at ./include/linux/dma-mapping.h:516 esp_sbus_probe+0x57c/0x700
[   11.718646] Modules linked in:
[   11.754977] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.18.0-12952-g2923b27-dirty #239
[   11.849770] Call Trace:
[   11.878854]  [0000000000457af0] __warn+0xb0/0xe0
[   11.934092]  [000000000071d47c] esp_sbus_probe+0x57c/0x700
[   11.999738]  [00000000006f07cc] platform_drv_probe+0x2c/0xa0
[   12.067422]  [00000000006ee9fc] really_probe+0x19c/0x2e0
[   12.130953]  [00000000006eef10] driver_probe_device+0x50/0x100
[   12.200750]  [00000000006ef0b4] __driver_attach+0xf4/0x120
[   12.266361]  [00000000006ecbc4] bus_for_each_dev+0x44/0x80
[   12.331980]  [00000000006edc18] bus_add_driver+0x198/0x220
[   12.397605]  [00000000006efb10] driver_register+0x70/0x120
[   12.463229]  [0000000000427310] do_one_initcall+0x30/0x180
[   12.528857]  [0000000000954b2c] kernel_init_freeable+0x148/0x1e4
[   12.600737]  [0000000000838124] kernel_init+0x4/0x120
[   12.661120]  [0000000000406064] ret_from_fork+0x1c/0x2c
[   12.723604]  [0000000000000000]           (null)
[   12.782988] ---[ end trace 0d4c52020aafc2d4 ]---
[   12.841032] esp f006c230: esp0: regs[(____ptrval____):(____ptrval____)] irq[10]
[   12.930780] esp f006c230: esp0: is a FASHME, 40 MHz (ccf=0), SCSI ID 7
[   16.097212] scsi host0: esp
[   16.135602] scsi 0:0:0:0: Direct-Access     FUJITSU  MAP3367N SUN36G  0401 PQ: 0 ANSI: 4
[   16.235036] scsi target0:0:0: Beginning Domain Validation
[   16.307457] scsi target0:0:0: FAST-10 WIDE SCSI 20.0 MB/s ST (100 ns, offset 15)
[   16.399928] scsi target0:0:0: Domain Validation skipping write tests
[   16.478336] scsi target0:0:0: Ending Domain Validation
[   17.721196] scsi 0:0:6:0: CD-ROM            NEC      CD-ROM DRIVE:463 1.05 PQ: 0 ANSI: 2
[   17.820629] scsi target0:0:6: Beginning Domain Validation
[   17.891527] scsi target0:0:6: FAST-10 SCSI 10.0 MB/s ST (100 ns, offset 15)
[   17.979824] scsi target0:0:6: Domain Validation skipping write tests
[   18.058282] scsi target0:0:6: Ending Domain Validation
[   20.000261] sd 0:0:0:0: Power-on or device reset occurred
[   20.067471] mousedev: PS/2 mouse device common for all mice
[   20.138372] rtc-m48t59 rtc-m48t59.0: registered as rtc0
[   20.204324] NET: Registered protocol family 17
[   20.255650] sd 0:0:0:0: [sda] 71132959 512-byte logical blocks: (36.4 GB/33.9 GiB)
[   20.259821] Key type dns_resolver registered
[   20.407848] rtc-m48t59 rtc-m48t59.0: setting system clock to 2018-08-27 18:49:51 UTC (1535395791)
[   20.516793] sd 0:0:0:0: [sda] Write Protect is off
[   20.576704] sd 0:0:0:0: [sda] Mode Sense: b3 00 00 08
[   20.641255] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[   20.769811]  sda: sda1 sda2 sda3 sda4
[   20.823985] sd 0:0:0:0: [sda] Attached SCSI disk
[   21.218313] input: Sun Mouse as /devices/root/f005abc8/f005c9b8/serio1/input/input1
[   21.325293] random: fast init done
[   21.396507] EXT4-fs (sda2): mounted filesystem with ordered data mode. Opts: (null)
[   21.490805] VFS: Mounted root (ext4 filesystem) readonly on device 8:2.
[   21.596389] devtmpfs: mounted
[   21.635446] This architecture does not have kernel memory protection.
[   21.715165] Run /sbin/init as init process
[   24.104249] random: udevd: uninitialized urandom read (16 bytes read)
[   24.188187] random: udevd: uninitialized urandom read (16 bytes read)
[   24.269361] random: udevd: uninitialized urandom read (16 bytes read)
[   24.838696] flash f005b268: DMA mask not set
[   24.892363] /sbus@1f,0/flashprom@f,0: OBP Flash, RD 1fff0000000[80000] WR 1fff1380000[80000]
[   25.029284] hme f007280c: DMA mask not set
[   25.082398] sunhme.c:v3.10 August 26, 2008 David S. Miller (davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org)
[   25.173398] ------------[ cut here ]------------
[   25.231068] WARNING: CPU: 0 PID: 594 at ./include/linux/dma-mapping.h:516 happy_meal_sbus_probe_one+0x7a8/0x8c0 [sunhme]
[   25.363817] Modules linked in: sunhme(+) soundcore flash
[   25.429833] CPU: 0 PID: 594 Comm: udevd Tainted: G        W         4.18.0-12952-g2923b27-dirty #239
[   25.541685] Call Trace:
[   25.573303]  [0000000000457af0] __warn+0xb0/0xe0
[   25.631011]  [0000000010012828] happy_meal_sbus_probe_one+0x7a8/0x8c0 [sunhme]
[   25.720023]  [00000000006f07cc] platform_drv_probe+0x2c/0xa0
[   25.790310]  [00000000006ee9fc] really_probe+0x19c/0x2e0
[   25.856351]  [00000000006eef10] driver_probe_device+0x50/0x100
[   25.928639]  [00000000006ef0b4] __driver_attach+0xf4/0x120
[   25.996762]  [00000000006ecbc4] bus_for_each_dev+0x44/0x80
[   26.064887]  [00000000006edc18] bus_add_driver+0x198/0x220
[   26.133128]  [00000000006efb10] driver_register+0x70/0x120
[   26.201344]  [0000000010018010] happy_meal_probe+0x10/0xc0 [sunhme]
[   26.278959]  [0000000000427310] do_one_initcall+0x30/0x180
[   26.347181]  [00000000004cb4e8] do_init_module+0x4c/0x1c4
[   26.414307]  [00000000004ca428] load_module+0x11c8/0x1260
[   26.481388]  [00000000004ca634] sys_finit_module+0x74/0xa0
[   26.549474]  [00000000004061b4] linux_sparc_syscall32+0x34/0x60
[   26.622824] ---[ end trace 0d4c52020aafc2d6 ]---
[   26.682802] eth0: HAPPY MEAL (SBUS) 10/100baseT Ethernet 
[   26.682813] 08:00:20:89:2a:a0
[   26.787983] hme f007a418: DMA mask not set
[   26.847151] sd 0:0:0:0: Attached scsi generic sg0 type 0
[   26.910437] eth1: Quattro HME slot 0 (SBUS) 10/100baseT Ethernet 
[   26.913242] 08:00:20:cc:93:40
[   27.028194] hme f00803cc: DMA mask not set
[   27.082052] eth2: Quattro HME slot 1 (SBUS) 10/100baseT Ethernet 
[   27.082063] 08:00:20:cc:93:41
[   27.190917] bpp f007a25c: DMA mask not set
[   27.195172] hme f00862a8: DMA mask not set
[   27.293628] parport0: sunbpp at 0x1ffec800000
[   27.300035] eth3: Quattro HME slot 2 (SBUS) 10/100baseT Ethernet 
[   27.352282] 08:00:20:cc:93:42
[   27.465580] hme f008c9c4: DMA mask not set
[   27.520730] eth4: Quattro HME slot 3 (SBUS) 10/100baseT Ethernet 
[   27.520740] 08:00:20:cc:93:43
[   27.642120] scsi 0:0:6:0: Attached scsi generic sg1 type 5
[   27.711314] sr 0:0:6:0: Power-on or device reset occurred
[   27.784509] sr 0:0:6:0: [sr0] scsi-1 drive
[   27.837306] cdrom: Uniform CD-ROM driver Revision: 3.20
[   27.914630] audio f005b0cc: DMA mask not set
[   27.980828] sr 0:0:6:0: Attached scsi CD-ROM sr0
[   28.158845] ------------[ cut here ]------------
[   28.216326] WARNING: CPU: 1 PID: 580 at ./include/linux/dma-mapping.h:516 snd_dma_alloc_pages+0x180/0x1a0 [snd_pcm]
[   28.343408] Modules linked in: snd_sun_cs4231(+) sr_mod cdrom parport_sunbpp snd_pcm evdev parport snd_timer sg snd sunhme soundcore flash
[   28.494661] CPU: 1 PID: 580 Comm: udevd Tainted: G        W         4.18.0-12952-g2923b27-dirty #239
[   28.606119] Call Trace:
[   28.637303]  [0000000000457af0] __warn+0xb0/0xe0
[   28.694687]  [00000000100a91a0] snd_dma_alloc_pages+0x180/0x1a0 [snd_pcm]
[   28.778220]  [00000000100a8918] snd_pcm_lib_preallocate_pages1+0x118/0x1a0 [snd_pcm]
[   28.873222]  [00000000100a89d8] snd_pcm_lib_preallocate_pages_for_all+0x38/0x80 [snd_pcm]
[   28.973388]  [00000000100dbf18] cs4231_probe+0x678/0x820 [snd_sun_cs4231]
[   29.056744]  [00000000006f07cc] platform_drv_probe+0x2c/0xa0
[   29.126586]  [00000000006ee9fc] really_probe+0x19c/0x2e0
[   29.192167]  [00000000006eef10] driver_probe_device+0x50/0x100
[   29.263973]  [00000000006ef0b4] __driver_attach+0xf4/0x120
[   29.331480]  [00000000006ecbc4] bus_for_each_dev+0x44/0x80
[   29.398927]  [00000000006edc18] bus_add_driver+0x198/0x220
[   29.466364]  [00000000006efb10] driver_register+0x70/0x120
[   29.533766]  [0000000000427310] do_one_initcall+0x30/0x180
[   29.601227]  [00000000004cb4e8] do_init_module+0x4c/0x1c4
[   29.667536]  [00000000004ca428] load_module+0x11c8/0x1260
[   29.733883]  [00000000004ca634] sys_finit_module+0x74/0xa0
[   29.801342] ---[ end trace 0d4c52020aafc2d7 ]---
[   31.012131] random: crng init done
[   31.054663] random: 1 urandom warning(s) missed due to ratelimiting
[   31.441800] Adding 722912k swap on /dev/sda4.  Priority:-2 extents:1 across:722912k 
[   31.720740] EXT4-fs (sda2): re-mounted. Opts: (null)
[   32.176380] EXT4-fs (sda2): re-mounted. Opts: errors=remount-ro
[   34.126095] loop: module loaded
[   34.679947] EXT4-fs (sda1): mounting ext2 file system using the ext4 subsystem
[   34.788477] EXT4-fs (sda1): mounted filesystem without journal. Opts: (null)
[   37.302565] NET: Registered protocol family 10
[   37.362653] Segment Routing with IPv6
[   41.620058] eth0: Link is up using 
[   41.620074] internal 
[   41.663868] transceiver at 
[   41.692882] 100Mb/s, Full Duplex.

-- 
Meelis Roos (mroos-Y27EyoLml9s@public.gmane.org)

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: new SBus related DMA warnings in 4.18+git
       [not found]     ` <20180827154716.GA30492-jcswGhMUV9g@public.gmane.org>
@ 2018-08-27 19:15         ` Sam Ravnborg
  2018-08-27 19:15         ` Sam Ravnborg
  1 sibling, 0 replies; 22+ messages in thread
From: Sam Ravnborg @ 2018-08-27 19:15 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: sparclinux-u79uwXL29TY76Z2rM5mHXA, Meelis Roos,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA

Hi Christoph.

On Mon, Aug 27, 2018 at 05:47:16PM +0200, Christoph Hellwig wrote:
> On Sun, Aug 26, 2018 at 10:48:44AM +0300, Meelis Roos wrote:
> > Tried yesterdays git 4.18.0-12789-gaa5b105 on a Sun Ultra 1 with SBus 
> > and several SBus connected devicess give DMA mapping related warnings:
> 
> This should have been around since the warning was added.
> 
> The patch below should fix it:
> 
> ---
> >From 6294e0e330851ee06e66ab85b348f1d92d375d7a Mon Sep 17 00:00:00 2001
> From: Christoph Hellwig <hch@lst.de>
> Date: Mon, 27 Aug 2018 17:23:24 +0200
> Subject: driver core: initialize a default DMA mask for platform device
> 
> We still treat devices without a DMA mask as defaulting to 32-bits for
> both mask, but a few releases ago we've started warning about such
> cases, as they require special cases to work around this sloppyness.
> Add a dma_mask field to struct platform_object so that we can initialize
> the dma_mask pointer in struct device and initialize both masks to
> 32-bits by default.  Architectures can still override this in
> arch_setup_pdev_archdata if needed.
> 
> Note that the code looks a little odd with the various conditionals
> because we have to support platform_device structures that are
> statically allocated.
I know the patch did not work out as intended - saw another thread.
But this looks like the patch just paper over the fact that
the drivers are missing to set the DMA mask.

Why not fix the drivers rather than papering over the fact
that they are missing the DMA mask?

We are in the lucky situation the Meelis can test any patches.

	Sam

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: new SBus related DMA warnings in 4.18+git
@ 2018-08-27 19:15         ` Sam Ravnborg
  0 siblings, 0 replies; 22+ messages in thread
From: Sam Ravnborg @ 2018-08-27 19:15 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: sparclinux-u79uwXL29TY76Z2rM5mHXA, Meelis Roos,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA

Hi Christoph.

On Mon, Aug 27, 2018 at 05:47:16PM +0200, Christoph Hellwig wrote:
> On Sun, Aug 26, 2018 at 10:48:44AM +0300, Meelis Roos wrote:
> > Tried yesterdays git 4.18.0-12789-gaa5b105 on a Sun Ultra 1 with SBus 
> > and several SBus connected devicess give DMA mapping related warnings:
> 
> This should have been around since the warning was added.
> 
> The patch below should fix it:
> 
> ---
> >From 6294e0e330851ee06e66ab85b348f1d92d375d7a Mon Sep 17 00:00:00 2001
> From: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
> Date: Mon, 27 Aug 2018 17:23:24 +0200
> Subject: driver core: initialize a default DMA mask for platform device
> 
> We still treat devices without a DMA mask as defaulting to 32-bits for
> both mask, but a few releases ago we've started warning about such
> cases, as they require special cases to work around this sloppyness.
> Add a dma_mask field to struct platform_object so that we can initialize
> the dma_mask pointer in struct device and initialize both masks to
> 32-bits by default.  Architectures can still override this in
> arch_setup_pdev_archdata if needed.
> 
> Note that the code looks a little odd with the various conditionals
> because we have to support platform_device structures that are
> statically allocated.
I know the patch did not work out as intended - saw another thread.
But this looks like the patch just paper over the fact that
the drivers are missing to set the DMA mask.

Why not fix the drivers rather than papering over the fact
that they are missing the DMA mask?

We are in the lucky situation the Meelis can test any patches.

	Sam

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: new SBus related DMA warnings in 4.18+git
       [not found]         ` <20180827191518.GA26665-uyr5N9Q2VtJg9hUCZPvPmw@public.gmane.org>
@ 2018-08-27 20:41             ` David Miller
  0 siblings, 0 replies; 22+ messages in thread
From: David Miller @ 2018-08-27 20:41 UTC (permalink / raw)
  To: sam-uyr5N9Q2VtJg9hUCZPvPmw
  Cc: sparclinux-u79uwXL29TY76Z2rM5mHXA, mroos-Y27EyoLml9s,
	hch-jcswGhMUV9g,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA

From: Sam Ravnborg <sam@ravnborg.org>
Date: Mon, 27 Aug 2018 21:15:18 +0200

> Why not fix the drivers rather than papering over the fact
> that they are missing the DMA mask?
> 
> We are in the lucky situation the Meelis can test any patches.

SBUS drivers never set the mask because they never needed to and could
use the default, since SBUS IOMMUs were quite universal in nature.

I think it's more error prone to add the mask setting to every single
SBUS driver than to just have the core setup the default properly.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: new SBus related DMA warnings in 4.18+git
@ 2018-08-27 20:41             ` David Miller
  0 siblings, 0 replies; 22+ messages in thread
From: David Miller @ 2018-08-27 20:41 UTC (permalink / raw)
  To: sam-uyr5N9Q2VtJg9hUCZPvPmw
  Cc: sparclinux-u79uwXL29TY76Z2rM5mHXA, mroos-Y27EyoLml9s,
	hch-jcswGhMUV9g,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA

From: Sam Ravnborg <sam-uyr5N9Q2VtJg9hUCZPvPmw@public.gmane.org>
Date: Mon, 27 Aug 2018 21:15:18 +0200

> Why not fix the drivers rather than papering over the fact
> that they are missing the DMA mask?
> 
> We are in the lucky situation the Meelis can test any patches.

SBUS drivers never set the mask because they never needed to and could
use the default, since SBUS IOMMUs were quite universal in nature.

I think it's more error prone to add the mask setting to every single
SBUS driver than to just have the core setup the default properly.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: new SBus related DMA warnings in 4.18+git
       [not found]             ` <20180827.134136.955064444069965259.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
@ 2018-08-28  9:24                 ` Christoph Hellwig
  0 siblings, 0 replies; 22+ messages in thread
From: Christoph Hellwig @ 2018-08-28  9:24 UTC (permalink / raw)
  To: David Miller
  Cc: sparclinux-u79uwXL29TY76Z2rM5mHXA, mroos-Y27EyoLml9s,
	sam-uyr5N9Q2VtJg9hUCZPvPmw, hch-jcswGhMUV9g,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA

On Mon, Aug 27, 2018 at 01:41:36PM -0700, David Miller wrote:
> From: Sam Ravnborg <sam@ravnborg.org>
> Date: Mon, 27 Aug 2018 21:15:18 +0200
> 
> > Why not fix the drivers rather than papering over the fact
> > that they are missing the DMA mask?
> > 
> > We are in the lucky situation the Meelis can test any patches.
> 
> SBUS drivers never set the mask because they never needed to and could
> use the default, since SBUS IOMMUs were quite universal in nature.

In addition to that the historical expectation is that you can do
dma to platform_devices without setup, and for some reason sbus
devices all show up as platform_devices.

> I think it's more error prone to add the mask setting to every single
> SBUS driver than to just have the core setup the default properly.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: new SBus related DMA warnings in 4.18+git
@ 2018-08-28  9:24                 ` Christoph Hellwig
  0 siblings, 0 replies; 22+ messages in thread
From: Christoph Hellwig @ 2018-08-28  9:24 UTC (permalink / raw)
  To: David Miller
  Cc: sparclinux-u79uwXL29TY76Z2rM5mHXA, mroos-Y27EyoLml9s,
	sam-uyr5N9Q2VtJg9hUCZPvPmw, hch-jcswGhMUV9g,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA

On Mon, Aug 27, 2018 at 01:41:36PM -0700, David Miller wrote:
> From: Sam Ravnborg <sam-uyr5N9Q2VtJg9hUCZPvPmw@public.gmane.org>
> Date: Mon, 27 Aug 2018 21:15:18 +0200
> 
> > Why not fix the drivers rather than papering over the fact
> > that they are missing the DMA mask?
> > 
> > We are in the lucky situation the Meelis can test any patches.
> 
> SBUS drivers never set the mask because they never needed to and could
> use the default, since SBUS IOMMUs were quite universal in nature.

In addition to that the historical expectation is that you can do
dma to platform_devices without setup, and for some reason sbus
devices all show up as platform_devices.

> I think it's more error prone to add the mask setting to every single
> SBUS driver than to just have the core setup the default properly.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: new SBus related DMA warnings in 4.18+git
       [not found]         ` <alpine.LRH.2.21.1808272203270.28446-ptEonEWSGqKptlylMvRsHA@public.gmane.org>
@ 2018-08-28  9:29             ` Christoph Hellwig
  0 siblings, 0 replies; 22+ messages in thread
From: Christoph Hellwig @ 2018-08-28  9:29 UTC (permalink / raw)
  To: Meelis Roos
  Cc: sparclinux-u79uwXL29TY76Z2rM5mHXA,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	Christoph Hellwig

On Mon, Aug 27, 2018 at 10:04:58PM +0300, Meelis Roos wrote:
> > On Sun, Aug 26, 2018 at 10:48:44AM +0300, Meelis Roos wrote:
> > > Tried yesterdays git 4.18.0-12789-gaa5b105 on a Sun Ultra 1 with SBus 
> > > and several SBus connected devicess give DMA mapping related warnings:
> > 
> > This should have been around since the warning was added.
> > 
> > The patch below should fix it:
> > 
> > ---
> > >From 6294e0e330851ee06e66ab85b348f1d92d375d7a Mon Sep 17 00:00:00 2001
> > From: Christoph Hellwig <hch@lst.de>
> > Date: Mon, 27 Aug 2018 17:23:24 +0200
> > Subject: driver core: initialize a default DMA mask for platform device
> 
> No, it does not fix it. Dmesg from another SBus machine that conmpiled 
> it faster (Sun Ultra 2):

Based on the other thread here is a new attempt:

---
diff --git a/arch/sparc/kernel/of_device_32.c b/arch/sparc/kernel/of_device_32.c
index 3641a294ed54..1738f7f12a9f 100644
--- a/arch/sparc/kernel/of_device_32.c
+++ b/arch/sparc/kernel/of_device_32.c
@@ -381,6 +381,10 @@ static struct platform_device * __init scan_one_device(struct device_node *dp,
 	else
 		dev_set_name(&op->dev, "%08x", dp->phandle);
 
+	op->dev.coherent_dma_mask = DMA_BIT_MASK(32);
+	op->dev.dma_mask = &op->dma_mask;
+	op->dma_mask = DMA_BIT_MASK(32);
+
 	if (of_device_register(op)) {
 		printk("%s: Could not register of device.\n",
 		       dp->full_name);
diff --git a/arch/sparc/kernel/of_device_64.c b/arch/sparc/kernel/of_device_64.c
index 44e4d4435bed..60ebb1f976ab 100644
--- a/arch/sparc/kernel/of_device_64.c
+++ b/arch/sparc/kernel/of_device_64.c
@@ -675,6 +675,9 @@ static struct platform_device * __init scan_one_device(struct device_node *dp,
 		dev_set_name(&op->dev, "root");
 	else
 		dev_set_name(&op->dev, "%08x", dp->phandle);
+	op->dev.coherent_dma_mask = DMA_BIT_MASK(32);
+	op->dev.dma_mask = &op->dma_mask;
+	op->dma_mask = DMA_BIT_MASK(32);
 
 	if (of_device_register(op)) {
 		printk("%s: Could not register of device.\n",

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Re: new SBus related DMA warnings in 4.18+git
@ 2018-08-28  9:29             ` Christoph Hellwig
  0 siblings, 0 replies; 22+ messages in thread
From: Christoph Hellwig @ 2018-08-28  9:29 UTC (permalink / raw)
  To: Meelis Roos
  Cc: sparclinux-u79uwXL29TY76Z2rM5mHXA,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	Christoph Hellwig

On Mon, Aug 27, 2018 at 10:04:58PM +0300, Meelis Roos wrote:
> > On Sun, Aug 26, 2018 at 10:48:44AM +0300, Meelis Roos wrote:
> > > Tried yesterdays git 4.18.0-12789-gaa5b105 on a Sun Ultra 1 with SBus 
> > > and several SBus connected devicess give DMA mapping related warnings:
> > 
> > This should have been around since the warning was added.
> > 
> > The patch below should fix it:
> > 
> > ---
> > >From 6294e0e330851ee06e66ab85b348f1d92d375d7a Mon Sep 17 00:00:00 2001
> > From: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
> > Date: Mon, 27 Aug 2018 17:23:24 +0200
> > Subject: driver core: initialize a default DMA mask for platform device
> 
> No, it does not fix it. Dmesg from another SBus machine that conmpiled 
> it faster (Sun Ultra 2):

Based on the other thread here is a new attempt:

---
diff --git a/arch/sparc/kernel/of_device_32.c b/arch/sparc/kernel/of_device_32.c
index 3641a294ed54..1738f7f12a9f 100644
--- a/arch/sparc/kernel/of_device_32.c
+++ b/arch/sparc/kernel/of_device_32.c
@@ -381,6 +381,10 @@ static struct platform_device * __init scan_one_device(struct device_node *dp,
 	else
 		dev_set_name(&op->dev, "%08x", dp->phandle);
 
+	op->dev.coherent_dma_mask = DMA_BIT_MASK(32);
+	op->dev.dma_mask = &op->dma_mask;
+	op->dma_mask = DMA_BIT_MASK(32);
+
 	if (of_device_register(op)) {
 		printk("%s: Could not register of device.\n",
 		       dp->full_name);
diff --git a/arch/sparc/kernel/of_device_64.c b/arch/sparc/kernel/of_device_64.c
index 44e4d4435bed..60ebb1f976ab 100644
--- a/arch/sparc/kernel/of_device_64.c
+++ b/arch/sparc/kernel/of_device_64.c
@@ -675,6 +675,9 @@ static struct platform_device * __init scan_one_device(struct device_node *dp,
 		dev_set_name(&op->dev, "root");
 	else
 		dev_set_name(&op->dev, "%08x", dp->phandle);
+	op->dev.coherent_dma_mask = DMA_BIT_MASK(32);
+	op->dev.dma_mask = &op->dma_mask;
+	op->dma_mask = DMA_BIT_MASK(32);
 
 	if (of_device_register(op)) {
 		printk("%s: Could not register of device.\n",

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Re: new SBus related DMA warnings in 4.18+git
       [not found]             ` <20180828092915.GC12488-jcswGhMUV9g@public.gmane.org>
@ 2018-08-28 10:30                 ` Meelis Roos
  0 siblings, 0 replies; 22+ messages in thread
From: Meelis Roos @ 2018-08-28 10:30 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: sparclinux-u79uwXL29TY76Z2rM5mHXA,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA

> Based on the other thread here is a new attempt:

  CC      arch/sparc/kernel/of_device_64.o
arch/sparc/kernel/of_device_64.c: In function ¡scan_one_device¢:
arch/sparc/kernel/of_device_64.c:678:2: error: implicit declaration of function ¡DMA_BIT_MASK¢ [-Werror=implicit-function-declaration]
  op->dev.coherent_dma_mask = DMA_BIT_MASK(32);
  ^
arch/sparc/kernel/of_device_64.c:679:24: error: ¡struct platform_device¢ has no member named ¡dma_mask¢
  op->dev.dma_mask = &op->dma_mask;
                        ^
arch/sparc/kernel/of_device_64.c:680:4: error: ¡struct platform_device¢ has no member named ¡dma_mask¢
  op->dma_mask = DMA_BIT_MASK(32);
    ^
cc1: all warnings being treated as errors
scripts/Makefile.build:307: recipe for target 'arch/sparc/kernel/of_device_64.o' failed


-- 
Meelis Roos (mroos@linux.ee)

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: new SBus related DMA warnings in 4.18+git
@ 2018-08-28 10:30                 ` Meelis Roos
  0 siblings, 0 replies; 22+ messages in thread
From: Meelis Roos @ 2018-08-28 10:30 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: sparclinux-u79uwXL29TY76Z2rM5mHXA,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA

> Based on the other thread here is a new attempt:

  CC      arch/sparc/kernel/of_device_64.o
arch/sparc/kernel/of_device_64.c: In function ‘scan_one_device’:
arch/sparc/kernel/of_device_64.c:678:2: error: implicit declaration of function ‘DMA_BIT_MASK’ [-Werror=implicit-function-declaration]
  op->dev.coherent_dma_mask = DMA_BIT_MASK(32);
  ^
arch/sparc/kernel/of_device_64.c:679:24: error: ‘struct platform_device’ has no member named ‘dma_mask’
  op->dev.dma_mask = &op->dma_mask;
                        ^
arch/sparc/kernel/of_device_64.c:680:4: error: ‘struct platform_device’ has no member named ‘dma_mask’
  op->dma_mask = DMA_BIT_MASK(32);
    ^
cc1: all warnings being treated as errors
scripts/Makefile.build:307: recipe for target 'arch/sparc/kernel/of_device_64.o' failed


-- 
Meelis Roos (mroos@linux.ee)
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: new SBus related DMA warnings in 4.18+git
       [not found]                 ` <alpine.LRH.2.21.1808281330270.13945-ptEonEWSGqKptlylMvRsHA@public.gmane.org>
@ 2018-08-28 11:43                     ` Christoph Hellwig
  0 siblings, 0 replies; 22+ messages in thread
From: Christoph Hellwig @ 2018-08-28 11:43 UTC (permalink / raw)
  To: Meelis Roos
  Cc: sparclinux-u79uwXL29TY76Z2rM5mHXA,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	Christoph Hellwig

[-- Attachment #1: Type: text/plain, Size: 209 bytes --]

Updated version including that has survived contact with a sparc cross
compiler below.  Note that this is on top of the previous patch adding
a dma_mask to struct platform_device, which I've included as well.

[-- Attachment #2: 0001-driver-core-initialize-a-default-DMA-mask-for-platfo.patch --]
[-- Type: text/x-patch, Size: 2646 bytes --]

From e22d27b9bf48c0e3d6eb106f596972c9357ed24d Mon Sep 17 00:00:00 2001
From: Christoph Hellwig <hch@lst.de>
Date: Mon, 27 Aug 2018 17:23:24 +0200
Subject: driver core: initialize a default DMA mask for platform device

We still treat devices without a DMA mask as defaulting to 32-bits for
both mask, but a few releases ago we've started warning about such
cases, as they require special cases to work around this sloppyness.
Add a dma_mask field to struct platform_object so that we can initialize
the dma_mask pointer in struct device and initialize both masks to
32-bits by default.  Architectures can still override this in
arch_setup_pdev_archdata if needed.

Note that the code looks a little odd with the various conditionals
because we have to support platform_device structures that are
statically allocated.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/base/platform.c         | 15 +++++++++++++--
 include/linux/platform_device.h |  1 +
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index dff82a3c2caa..baf4b06cf2d9 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -225,6 +225,17 @@ struct platform_object {
 	char name[];
 };
 
+static void setup_pdev_archdata(struct platform_device *pdev)
+{
+	if (!pdev->dev.coherent_dma_mask)
+		pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
+	if (!pdev->dma_mask)
+		pdev->dma_mask = DMA_BIT_MASK(32);
+	if (!pdev->dev.dma_mask)
+		pdev->dev.dma_mask = &pdev->dma_mask;
+	arch_setup_pdev_archdata(pdev);
+};
+
 /**
  * platform_device_put - destroy a platform device
  * @pdev: platform device to free
@@ -271,7 +282,7 @@ struct platform_device *platform_device_alloc(const char *name, int id)
 		pa->pdev.id = id;
 		device_initialize(&pa->pdev.dev);
 		pa->pdev.dev.release = platform_device_release;
-		arch_setup_pdev_archdata(&pa->pdev);
+		setup_pdev_archdata(&pa->pdev);
 	}
 
 	return pa ? &pa->pdev : NULL;
@@ -472,7 +483,7 @@ EXPORT_SYMBOL_GPL(platform_device_del);
 int platform_device_register(struct platform_device *pdev)
 {
 	device_initialize(&pdev->dev);
-	arch_setup_pdev_archdata(pdev);
+	setup_pdev_archdata(pdev);
 	return platform_device_add(pdev);
 }
 EXPORT_SYMBOL_GPL(platform_device_register);
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index 1a9f38f27f65..d9dc4883d5fb 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -25,6 +25,7 @@ struct platform_device {
 	int		id;
 	bool		id_auto;
 	struct device	dev;
+	u64		dma_mask;
 	u32		num_resources;
 	struct resource	*resource;
 
-- 
2.18.0


[-- Attachment #3: 0002-sparc-set-a-default-32-bit-dma-mask-for-OF-devices.patch --]
[-- Type: text/x-patch, Size: 2119 bytes --]

From b4c6e6779559a1bcda41fad0f2e8b713fcf96446 Mon Sep 17 00:00:00 2001
From: Christoph Hellwig <hch@lst.de>
Date: Tue, 28 Aug 2018 11:25:51 +0200
Subject: sparc: set a default 32-bit dma mask for OF devices

This keeps the historic default behavior for devices without a DMA mask,
but removes the warning about a lacking DMA mask for doing DMA without
a mask.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 arch/sparc/kernel/of_device_32.c | 5 +++++
 arch/sparc/kernel/of_device_64.c | 4 ++++
 2 files changed, 9 insertions(+)

diff --git a/arch/sparc/kernel/of_device_32.c b/arch/sparc/kernel/of_device_32.c
index 3641a294ed54..7f3dec7e1e78 100644
--- a/arch/sparc/kernel/of_device_32.c
+++ b/arch/sparc/kernel/of_device_32.c
@@ -9,6 +9,7 @@
 #include <linux/irq.h>
 #include <linux/of_device.h>
 #include <linux/of_platform.h>
+#include <linux/dma-mapping.h>
 #include <asm/leon.h>
 #include <asm/leon_amba.h>
 
@@ -381,6 +382,10 @@ static struct platform_device * __init scan_one_device(struct device_node *dp,
 	else
 		dev_set_name(&op->dev, "%08x", dp->phandle);
 
+	op->dev.coherent_dma_mask = DMA_BIT_MASK(32);
+	op->dev.dma_mask = &op->dma_mask;
+	op->dma_mask = DMA_BIT_MASK(32);
+
 	if (of_device_register(op)) {
 		printk("%s: Could not register of device.\n",
 		       dp->full_name);
diff --git a/arch/sparc/kernel/of_device_64.c b/arch/sparc/kernel/of_device_64.c
index 44e4d4435bed..d94c31822da1 100644
--- a/arch/sparc/kernel/of_device_64.c
+++ b/arch/sparc/kernel/of_device_64.c
@@ -2,6 +2,7 @@
 #include <linux/string.h>
 #include <linux/kernel.h>
 #include <linux/of.h>
+#include <linux/dma-mapping.h>
 #include <linux/init.h>
 #include <linux/export.h>
 #include <linux/mod_devicetable.h>
@@ -675,6 +676,9 @@ static struct platform_device * __init scan_one_device(struct device_node *dp,
 		dev_set_name(&op->dev, "root");
 	else
 		dev_set_name(&op->dev, "%08x", dp->phandle);
+	op->dev.coherent_dma_mask = DMA_BIT_MASK(32);
+	op->dev.dma_mask = &op->dma_mask;
+	op->dma_mask = DMA_BIT_MASK(32);
 
 	if (of_device_register(op)) {
 		printk("%s: Could not register of device.\n",
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Re: new SBus related DMA warnings in 4.18+git
@ 2018-08-28 11:43                     ` Christoph Hellwig
  0 siblings, 0 replies; 22+ messages in thread
From: Christoph Hellwig @ 2018-08-28 11:43 UTC (permalink / raw)
  To: Meelis Roos
  Cc: sparclinux-u79uwXL29TY76Z2rM5mHXA,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	Christoph Hellwig

[-- Attachment #1: Type: text/plain, Size: 209 bytes --]

Updated version including that has survived contact with a sparc cross
compiler below.  Note that this is on top of the previous patch adding
a dma_mask to struct platform_device, which I've included as well.

[-- Attachment #2: 0001-driver-core-initialize-a-default-DMA-mask-for-platfo.patch --]
[-- Type: text/x-patch, Size: 2691 bytes --]

>From e22d27b9bf48c0e3d6eb106f596972c9357ed24d Mon Sep 17 00:00:00 2001
From: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
Date: Mon, 27 Aug 2018 17:23:24 +0200
Subject: driver core: initialize a default DMA mask for platform device

We still treat devices without a DMA mask as defaulting to 32-bits for
both mask, but a few releases ago we've started warning about such
cases, as they require special cases to work around this sloppyness.
Add a dma_mask field to struct platform_object so that we can initialize
the dma_mask pointer in struct device and initialize both masks to
32-bits by default.  Architectures can still override this in
arch_setup_pdev_archdata if needed.

Note that the code looks a little odd with the various conditionals
because we have to support platform_device structures that are
statically allocated.

Signed-off-by: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
---
 drivers/base/platform.c         | 15 +++++++++++++--
 include/linux/platform_device.h |  1 +
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index dff82a3c2caa..baf4b06cf2d9 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -225,6 +225,17 @@ struct platform_object {
 	char name[];
 };
 
+static void setup_pdev_archdata(struct platform_device *pdev)
+{
+	if (!pdev->dev.coherent_dma_mask)
+		pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
+	if (!pdev->dma_mask)
+		pdev->dma_mask = DMA_BIT_MASK(32);
+	if (!pdev->dev.dma_mask)
+		pdev->dev.dma_mask = &pdev->dma_mask;
+	arch_setup_pdev_archdata(pdev);
+};
+
 /**
  * platform_device_put - destroy a platform device
  * @pdev: platform device to free
@@ -271,7 +282,7 @@ struct platform_device *platform_device_alloc(const char *name, int id)
 		pa->pdev.id = id;
 		device_initialize(&pa->pdev.dev);
 		pa->pdev.dev.release = platform_device_release;
-		arch_setup_pdev_archdata(&pa->pdev);
+		setup_pdev_archdata(&pa->pdev);
 	}
 
 	return pa ? &pa->pdev : NULL;
@@ -472,7 +483,7 @@ EXPORT_SYMBOL_GPL(platform_device_del);
 int platform_device_register(struct platform_device *pdev)
 {
 	device_initialize(&pdev->dev);
-	arch_setup_pdev_archdata(pdev);
+	setup_pdev_archdata(pdev);
 	return platform_device_add(pdev);
 }
 EXPORT_SYMBOL_GPL(platform_device_register);
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index 1a9f38f27f65..d9dc4883d5fb 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -25,6 +25,7 @@ struct platform_device {
 	int		id;
 	bool		id_auto;
 	struct device	dev;
+	u64		dma_mask;
 	u32		num_resources;
 	struct resource	*resource;
 
-- 
2.18.0


[-- Attachment #3: 0002-sparc-set-a-default-32-bit-dma-mask-for-OF-devices.patch --]
[-- Type: text/x-patch, Size: 2164 bytes --]

>From b4c6e6779559a1bcda41fad0f2e8b713fcf96446 Mon Sep 17 00:00:00 2001
From: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
Date: Tue, 28 Aug 2018 11:25:51 +0200
Subject: sparc: set a default 32-bit dma mask for OF devices

This keeps the historic default behavior for devices without a DMA mask,
but removes the warning about a lacking DMA mask for doing DMA without
a mask.

Signed-off-by: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
---
 arch/sparc/kernel/of_device_32.c | 5 +++++
 arch/sparc/kernel/of_device_64.c | 4 ++++
 2 files changed, 9 insertions(+)

diff --git a/arch/sparc/kernel/of_device_32.c b/arch/sparc/kernel/of_device_32.c
index 3641a294ed54..7f3dec7e1e78 100644
--- a/arch/sparc/kernel/of_device_32.c
+++ b/arch/sparc/kernel/of_device_32.c
@@ -9,6 +9,7 @@
 #include <linux/irq.h>
 #include <linux/of_device.h>
 #include <linux/of_platform.h>
+#include <linux/dma-mapping.h>
 #include <asm/leon.h>
 #include <asm/leon_amba.h>
 
@@ -381,6 +382,10 @@ static struct platform_device * __init scan_one_device(struct device_node *dp,
 	else
 		dev_set_name(&op->dev, "%08x", dp->phandle);
 
+	op->dev.coherent_dma_mask = DMA_BIT_MASK(32);
+	op->dev.dma_mask = &op->dma_mask;
+	op->dma_mask = DMA_BIT_MASK(32);
+
 	if (of_device_register(op)) {
 		printk("%s: Could not register of device.\n",
 		       dp->full_name);
diff --git a/arch/sparc/kernel/of_device_64.c b/arch/sparc/kernel/of_device_64.c
index 44e4d4435bed..d94c31822da1 100644
--- a/arch/sparc/kernel/of_device_64.c
+++ b/arch/sparc/kernel/of_device_64.c
@@ -2,6 +2,7 @@
 #include <linux/string.h>
 #include <linux/kernel.h>
 #include <linux/of.h>
+#include <linux/dma-mapping.h>
 #include <linux/init.h>
 #include <linux/export.h>
 #include <linux/mod_devicetable.h>
@@ -675,6 +676,9 @@ static struct platform_device * __init scan_one_device(struct device_node *dp,
 		dev_set_name(&op->dev, "root");
 	else
 		dev_set_name(&op->dev, "%08x", dp->phandle);
+	op->dev.coherent_dma_mask = DMA_BIT_MASK(32);
+	op->dev.dma_mask = &op->dma_mask;
+	op->dma_mask = DMA_BIT_MASK(32);
 
 	if (of_device_register(op)) {
 		printk("%s: Could not register of device.\n",
-- 
2.18.0


[-- Attachment #4: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Re: new SBus related DMA warnings in 4.18+git
       [not found]                     ` <20180828114358.GA14519-jcswGhMUV9g@public.gmane.org>
@ 2018-08-29  5:47                         ` Meelis Roos
  0 siblings, 0 replies; 22+ messages in thread
From: Meelis Roos @ 2018-08-29  5:47 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: sparclinux-u79uwXL29TY76Z2rM5mHXA,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA

> Updated version including that has survived contact with a sparc cross
> compiler below.  Note that this is on top of the previous patch adding
> a dma_mask to struct platform_device, which I've included as well.

Works completely fine on both Ultra 1 and Ultra 2 - nothing DMA-relaated 
in dmesg.

-- 
Meelis Roos (mroos@linux.ee)

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: new SBus related DMA warnings in 4.18+git
@ 2018-08-29  5:47                         ` Meelis Roos
  0 siblings, 0 replies; 22+ messages in thread
From: Meelis Roos @ 2018-08-29  5:47 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: sparclinux-u79uwXL29TY76Z2rM5mHXA,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA

> Updated version including that has survived contact with a sparc cross
> compiler below.  Note that this is on top of the previous patch adding
> a dma_mask to struct platform_device, which I've included as well.

Works completely fine on both Ultra 1 and Ultra 2 - nothing DMA-relaated 
in dmesg.

-- 
Meelis Roos (mroos-Y27EyoLml9s@public.gmane.org)

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: new SBus related DMA warnings in 4.18+git
       [not found]                         ` <alpine.LRH.2.21.1808281649580.19903-ptEonEWSGqKptlylMvRsHA@public.gmane.org>
@ 2018-08-29  5:51                             ` Christoph Hellwig
  0 siblings, 0 replies; 22+ messages in thread
From: Christoph Hellwig @ 2018-08-29  5:51 UTC (permalink / raw)
  To: Meelis Roos
  Cc: sparclinux-u79uwXL29TY76Z2rM5mHXA,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	Christoph Hellwig

On Wed, Aug 29, 2018 at 08:47:04AM +0300, Meelis Roos wrote:
> > Updated version including that has survived contact with a sparc cross
> > compiler below.  Note that this is on top of the previous patch adding
> > a dma_mask to struct platform_device, which I've included as well.
> 
> Works completely fine on both Ultra 1 and Ultra 2 - nothing DMA-relaated 
> in dmesg.

Thanks for testing!  I'll submit the patch for 4.19 in a bit.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: new SBus related DMA warnings in 4.18+git
@ 2018-08-29  5:51                             ` Christoph Hellwig
  0 siblings, 0 replies; 22+ messages in thread
From: Christoph Hellwig @ 2018-08-29  5:51 UTC (permalink / raw)
  To: Meelis Roos
  Cc: sparclinux-u79uwXL29TY76Z2rM5mHXA,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	Christoph Hellwig

On Wed, Aug 29, 2018 at 08:47:04AM +0300, Meelis Roos wrote:
> > Updated version including that has survived contact with a sparc cross
> > compiler below.  Note that this is on top of the previous patch adding
> > a dma_mask to struct platform_device, which I've included as well.
> 
> Works completely fine on both Ultra 1 and Ultra 2 - nothing DMA-relaated 
> in dmesg.

Thanks for testing!  I'll submit the patch for 4.19 in a bit.

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2018-08-29  5:51 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-26  7:48 new SBus related DMA warnings in 4.18+git Meelis Roos
2018-08-26  7:48 ` Meelis Roos
     [not found] ` <alpine.LRH.2.21.1808260902280.22219-ptEonEWSGqKptlylMvRsHA@public.gmane.org>
2018-08-27 15:47   ` Christoph Hellwig
2018-08-27 15:47     ` Christoph Hellwig
     [not found]     ` <20180827154716.GA30492-jcswGhMUV9g@public.gmane.org>
2018-08-27 19:04       ` Meelis Roos
2018-08-27 19:04         ` Meelis Roos
     [not found]         ` <alpine.LRH.2.21.1808272203270.28446-ptEonEWSGqKptlylMvRsHA@public.gmane.org>
2018-08-28  9:29           ` Christoph Hellwig
2018-08-28  9:29             ` Christoph Hellwig
     [not found]             ` <20180828092915.GC12488-jcswGhMUV9g@public.gmane.org>
2018-08-28 10:30               ` Meelis Roos
2018-08-28 10:30                 ` Meelis Roos
     [not found]                 ` <alpine.LRH.2.21.1808281330270.13945-ptEonEWSGqKptlylMvRsHA@public.gmane.org>
2018-08-28 11:43                   ` Christoph Hellwig
2018-08-28 11:43                     ` Christoph Hellwig
     [not found]                     ` <20180828114358.GA14519-jcswGhMUV9g@public.gmane.org>
2018-08-29  5:47                       ` Meelis Roos
2018-08-29  5:47                         ` Meelis Roos
     [not found]                         ` <alpine.LRH.2.21.1808281649580.19903-ptEonEWSGqKptlylMvRsHA@public.gmane.org>
2018-08-29  5:51                           ` Christoph Hellwig
2018-08-29  5:51                             ` Christoph Hellwig
2018-08-27 19:15       ` Sam Ravnborg
2018-08-27 19:15         ` Sam Ravnborg
     [not found]         ` <20180827191518.GA26665-uyr5N9Q2VtJg9hUCZPvPmw@public.gmane.org>
2018-08-27 20:41           ` David Miller
2018-08-27 20:41             ` David Miller
     [not found]             ` <20180827.134136.955064444069965259.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2018-08-28  9:24               ` Christoph Hellwig
2018-08-28  9:24                 ` Christoph Hellwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.