Linux ATA/IDE development
 help / color / mirror / Atom feed
* Marvell 88SE9480 Port Multiplier Support
From: Andrew Ryder @ 2017-10-08  4:12 UTC (permalink / raw)
  To: linux-ide

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

Hello,

Does the mvsas support port multiplier for the marvell 88SE9480 chip?

I purchased an Addonics http://addonics.com/products/ad2ms6gpx8-e.php
but the card fails to see any of the attached drives.

I found an old message saying it might support sata pmp?
https://lkml.org/lkml/2014/4/24/413

I've attached a dmesg output also and I'm running kernel 4.9.36 if that
helps.

Andrew

[-- Attachment #2: dmesg.txt --]
[-- Type: text/plain, Size: 53930 bytes --]


[   26.552948] Adding 10485756k swap on /dev/sde2.  Priority:-1 extents:1 across:10485756k 
[   27.340199] XFS (md2): Mounting V5 Filesystem
[   27.353218] drivers/scsi/mvsas/mv_sas.c 1084:phy 0 attach dev info is 0
[   27.353220] drivers/scsi/mvsas/mv_sas.c 1086:phy 0 attach sas addr is 0
[   27.457219] drivers/scsi/mvsas/mv_sas.c 1084:phy 1 attach dev info is 0
[   27.457223] drivers/scsi/mvsas/mv_sas.c 1086:phy 1 attach sas addr is 0
[   27.561228] drivers/scsi/mvsas/mv_sas.c 1084:phy 2 attach dev info is 0
[   27.561232] drivers/scsi/mvsas/mv_sas.c 1086:phy 2 attach sas addr is 0
[   27.624964] XFS (md2): Ending clean mount
[   27.665276] drivers/scsi/mvsas/mv_sas.c 1084:phy 3 attach dev info is 0
[   27.665279] drivers/scsi/mvsas/mv_sas.c 1086:phy 3 attach sas addr is 0
[   28.499361] XFS (md4): Mounting V5 Filesystem
[   28.699789] XFS (md4): Ending clean mount
[   29.606690] dmesg (4463) used greatest stack depth: 12336 bytes left
[   30.458029] drivers/scsi/mvsas/mv_sas.c 1084:phy 4 attach dev info is 0
[   30.458033] drivers/scsi/mvsas/mv_sas.c 1086:phy 4 attach sas addr is 0
[   30.561104] drivers/scsi/mvsas/mv_sas.c 1084:phy 5 attach dev info is 0
[   30.561108] drivers/scsi/mvsas/mv_sas.c 1086:phy 5 attach sas addr is 0
[   30.665101] drivers/scsi/mvsas/mv_sas.c 1084:phy 6 attach dev info is 0
[   30.665104] drivers/scsi/mvsas/mv_sas.c 1086:phy 6 attach sas addr is 0
[   30.769103] drivers/scsi/mvsas/mv_sas.c 1084:phy 7 attach dev info is 0
[   30.769106] drivers/scsi/mvsas/mv_sas.c 1086:phy 7 attach sas addr is 0
[   30.769119] scsi host7: mvsas
[   33.661237] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
[   35.766389] igb 0000:02:00.1 eth1: igb: eth1 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX/TX
[   35.873087] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
[   42.371349] RPC: Registered named UNIX socket transport module.
[   42.371351] RPC: Registered udp transport module.
[   42.371352] RPC: Registered tcp transport module.
[   42.371353] RPC: Registered tcp NFSv4.1 backchannel transport module.
[   42.741605] Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
[   42.886122] NFSD: Using /var/lib/nfs/v4recovery as the NFSv4 state recovery directory
[   42.886130] NFSD: starting 90-second grace period (net ffffffff81cc6480)
[  125.862821] drivers/scsi/mvsas/mv_sas.c 1980:phy 6 ctrl sts=0x00111000.
[  125.862840] drivers/scsi/mvsas/mv_sas.c 1982:phy 6 irq sts = 0x00000081
[  125.894065] drivers/scsi/mvsas/mv_sas.c 1980:phy 4 ctrl sts=0x00111000.
[  125.894076] drivers/scsi/mvsas/mv_sas.c 1982:phy 4 irq sts = 0x00000081
[  125.911934] drivers/scsi/mvsas/mv_sas.c 1980:phy 5 ctrl sts=0x00111000.
[  125.911950] drivers/scsi/mvsas/mv_sas.c 1982:phy 5 irq sts = 0x00000081
[  126.375437] drivers/scsi/mvsas/mv_sas.c 1980:phy 6 ctrl sts=0x00111000.
[  126.375453] drivers/scsi/mvsas/mv_sas.c 1982:phy 6 irq sts = 0x00010000
[  126.375456] drivers/scsi/mvsas/mv_sas.c 2031:notify plug in on phy[2]
[  126.395462] drivers/scsi/mvsas/mv_94xx.c 885:get all reg link rate is 0x111000
[  126.395464] drivers/scsi/mvsas/mv_94xx.c 890:get link rate is 9
[  126.515497] drivers/scsi/mvsas/mv_sas.c 1084:phy 6 attach dev info is 20001
[  126.515499] drivers/scsi/mvsas/mv_sas.c 1086:phy 6 attach sas addr is 6
[  126.515510] drivers/scsi/mvsas/mv_sas.c 277:phy 6 byte dmaded.
[  126.515523] drivers/scsi/mvsas/mv_sas.c 1980:phy 4 ctrl sts=0x00111000.
[  126.515526] drivers/scsi/mvsas/mv_sas.c 1982:phy 4 irq sts = 0x00010000
[  126.515543] drivers/scsi/mvsas/mv_sas.c 2031:notify plug in on phy[0]
[  126.515670] sas: phy-7:6 added to port-7:0, phy_mask:0x4 ( 600000000000000)
[  126.535548] drivers/scsi/mvsas/mv_94xx.c 885:get all reg link rate is 0x111000
[  126.535551] drivers/scsi/mvsas/mv_94xx.c 890:get link rate is 9
[  126.655587] drivers/scsi/mvsas/mv_sas.c 1084:phy 4 attach dev info is 20001
[  126.655590] drivers/scsi/mvsas/mv_sas.c 1086:phy 4 attach sas addr is 4
[  126.655595] drivers/scsi/mvsas/mv_sas.c 277:phy 4 byte dmaded.
[  126.655599] drivers/scsi/mvsas/mv_sas.c 1980:phy 5 ctrl sts=0x00111000.
[  126.655601] drivers/scsi/mvsas/mv_sas.c 1982:phy 5 irq sts = 0x00010000
[  126.655606] drivers/scsi/mvsas/mv_sas.c 2031:notify plug in on phy[1]
[  126.675610] drivers/scsi/mvsas/mv_94xx.c 885:get all reg link rate is 0x111000
[  126.675612] drivers/scsi/mvsas/mv_94xx.c 890:get link rate is 9
[  126.795625] drivers/scsi/mvsas/mv_sas.c 1084:phy 5 attach dev info is 20001
[  126.795627] drivers/scsi/mvsas/mv_sas.c 1086:phy 5 attach sas addr is 5
[  126.795631] drivers/scsi/mvsas/mv_sas.c 277:phy 5 byte dmaded.
[  126.795768] sas: phy-7:4 added to port-7:1, phy_mask:0x1 ( 400000000000000)
[  126.795847] sas: phy-7:5 added to port-7:2, phy_mask:0x2 ( 500000000000000)
[  126.795865] sas: DOING DISCOVERY on port 0, pid:3059
[  126.795869] sas: DONE DISCOVERY on port 0, pid:3059, result:0
[  126.795880] sas: DOING DISCOVERY on port 1, pid:3059
[  126.795884] sas: DONE DISCOVERY on port 1, pid:3059, result:0
[  126.795895] sas: DOING DISCOVERY on port 2, pid:3059
[  126.795898] sas: DONE DISCOVERY on port 2, pid:3059, result:0
[  126.796008] sas: Enter sas_scsi_recover_host busy: 0 failed: 0
[  126.796111] sas: ata7: end_device-7:0: dev error handler
[  132.291272] ata7.00: qc timeout (cmd 0xec)
[  132.291279] drivers/scsi/mvsas/mv_sas.c 1545:mvs_abort_task() mvi=ffff880c2c780000 task=ffff88082f12df00 slot=ffff880c2c7a3578 slot_idx=x0
[  132.291285] ata7.00: failed to IDENTIFY (I/O error, err_mask=0x4)
[  132.301383] drivers/scsi/mvsas/mv_sas.c 1980:phy 6 ctrl sts=0x00111000.
[  132.301401] drivers/scsi/mvsas/mv_sas.c 1982:phy 6 irq sts = 0x00000081
[  132.811124] drivers/scsi/mvsas/mv_sas.c 1980:phy 6 ctrl sts=0x00111000.
[  132.811140] drivers/scsi/mvsas/mv_sas.c 1982:phy 6 irq sts = 0x00010000
[  132.811142] drivers/scsi/mvsas/mv_sas.c 2031:notify plug in on phy[2]
[  132.831148] drivers/scsi/mvsas/mv_94xx.c 885:get all reg link rate is 0x111000
[  132.831149] drivers/scsi/mvsas/mv_94xx.c 890:get link rate is 9
[  132.951183] drivers/scsi/mvsas/mv_sas.c 1084:phy 6 attach dev info is 20001
[  132.951185] drivers/scsi/mvsas/mv_sas.c 1086:phy 6 attach sas addr is 6
[  132.951191] drivers/scsi/mvsas/mv_sas.c 277:phy 6 byte dmaded.
[  134.531175] drivers/scsi/mvsas/mv_sas.c 1435:mvs_I_T_nexus_reset for device[0]:rc= 0
[  145.090588] ata7.00: qc timeout (cmd 0xec)
[  145.090594] drivers/scsi/mvsas/mv_sas.c 1545:mvs_abort_task() mvi=ffff880c2c780000 task=ffff88082f12df00 slot=ffff880c2c7a3578 slot_idx=x0
[  145.090599] ata7.00: failed to IDENTIFY (I/O error, err_mask=0x4)
[  145.100626] drivers/scsi/mvsas/mv_sas.c 1980:phy 6 ctrl sts=0x00000000.
[  145.100631] drivers/scsi/mvsas/mv_sas.c 1982:phy 6 irq sts = 0x00000001
[  145.100667] drivers/scsi/mvsas/mv_sas.c 1980:phy 6 ctrl sts=0x00111000.
[  145.100668] drivers/scsi/mvsas/mv_sas.c 1982:phy 6 irq sts = 0x00000081
[  145.610419] drivers/scsi/mvsas/mv_sas.c 1980:phy 6 ctrl sts=0x00111000.
[  145.610437] drivers/scsi/mvsas/mv_sas.c 1982:phy 6 irq sts = 0x00010000
[  145.610450] drivers/scsi/mvsas/mv_sas.c 2031:notify plug in on phy[2]
[  145.630455] drivers/scsi/mvsas/mv_94xx.c 885:get all reg link rate is 0x111000
[  145.630457] drivers/scsi/mvsas/mv_94xx.c 890:get link rate is 9
[  145.750510] drivers/scsi/mvsas/mv_sas.c 1084:phy 6 attach dev info is 20001
[  145.750512] drivers/scsi/mvsas/mv_sas.c 1086:phy 6 attach sas addr is 6
[  145.750514] drivers/scsi/mvsas/mv_sas.c 277:phy 6 byte dmaded.
[  147.330440] drivers/scsi/mvsas/mv_sas.c 1435:mvs_I_T_nexus_reset for device[0]:rc= 0
[  177.856715] ata7.00: qc timeout (cmd 0xec)
[  177.856720] drivers/scsi/mvsas/mv_sas.c 1545:mvs_abort_task() mvi=ffff880c2c780000 task=ffff88082f084d00 slot=ffff880c2c7a3578 slot_idx=x0
[  177.856725] ata7.00: failed to IDENTIFY (I/O error, err_mask=0x4)
[  177.866859] drivers/scsi/mvsas/mv_sas.c 1980:phy 6 ctrl sts=0x00111000.
[  177.866878] drivers/scsi/mvsas/mv_sas.c 1982:phy 6 irq sts = 0x00000081
[  178.376583] drivers/scsi/mvsas/mv_sas.c 1980:phy 6 ctrl sts=0x00111000.
[  178.376599] drivers/scsi/mvsas/mv_sas.c 1982:phy 6 irq sts = 0x00010000
[  178.376602] drivers/scsi/mvsas/mv_sas.c 2031:notify plug in on phy[2]
[  178.396608] drivers/scsi/mvsas/mv_94xx.c 885:get all reg link rate is 0x111000
[  178.396609] drivers/scsi/mvsas/mv_94xx.c 890:get link rate is 9
[  178.516629] drivers/scsi/mvsas/mv_sas.c 1084:phy 6 attach dev info is 20001
[  178.516631] drivers/scsi/mvsas/mv_sas.c 1086:phy 6 attach sas addr is 6
[  178.516633] drivers/scsi/mvsas/mv_sas.c 277:phy 6 byte dmaded.
[  180.096568] drivers/scsi/mvsas/mv_sas.c 1435:mvs_I_T_nexus_reset for device[0]:rc= 0
[  180.248660] sas: --- Exit sas_scsi_recover_host: busy: 0 failed: 0 tries: 1
[  180.261085] sas: Enter sas_scsi_recover_host busy: 0 failed: 0
[  180.261113] sas: ata7: end_device-7:0: dev error handler
[  180.261124] sas: ata8: end_device-7:1: dev error handler
[  185.536256] ata8.00: qc timeout (cmd 0xec)
[  185.536262] drivers/scsi/mvsas/mv_sas.c 1545:mvs_abort_task() mvi=ffff880c2c780000 task=ffff88082f1c0700 slot=ffff880c2c7a3578 slot_idx=x0
[  185.536266] ata8.00: failed to IDENTIFY (I/O error, err_mask=0x4)
[  185.546364] drivers/scsi/mvsas/mv_sas.c 1980:phy 4 ctrl sts=0x00111000.
[  185.546382] drivers/scsi/mvsas/mv_sas.c 1982:phy 4 irq sts = 0x00000081
[  186.052216] drivers/scsi/mvsas/mv_sas.c 1980:phy 4 ctrl sts=0x00111000.
[  186.052232] drivers/scsi/mvsas/mv_sas.c 1982:phy 4 irq sts = 0x00010000
[  186.052235] drivers/scsi/mvsas/mv_sas.c 2031:notify plug in on phy[0]
[  186.072245] drivers/scsi/mvsas/mv_94xx.c 885:get all reg link rate is 0x111000
[  186.072247] drivers/scsi/mvsas/mv_94xx.c 890:get link rate is 9
[  186.192266] drivers/scsi/mvsas/mv_sas.c 1084:phy 4 attach dev info is 20001
[  186.192268] drivers/scsi/mvsas/mv_sas.c 1086:phy 4 attach sas addr is 4
[  186.192275] drivers/scsi/mvsas/mv_sas.c 277:phy 4 byte dmaded.
[  187.776119] drivers/scsi/mvsas/mv_sas.c 1435:mvs_I_T_nexus_reset for device[1]:rc= 0
[  198.335558] ata8.00: qc timeout (cmd 0xec)
[  198.335564] drivers/scsi/mvsas/mv_sas.c 1545:mvs_abort_task() mvi=ffff880c2c780000 task=ffff88082f1c0e00 slot=ffff880c2c7a3578 slot_idx=x0
[  198.335568] ata8.00: failed to IDENTIFY (I/O error, err_mask=0x4)
[  198.345665] drivers/scsi/mvsas/mv_sas.c 1980:phy 4 ctrl sts=0x00111000.
[  198.345684] drivers/scsi/mvsas/mv_sas.c 1982:phy 4 irq sts = 0x00000081
[  198.851516] drivers/scsi/mvsas/mv_sas.c 1980:phy 4 ctrl sts=0x00111000.
[  198.851532] drivers/scsi/mvsas/mv_sas.c 1982:phy 4 irq sts = 0x00010000
[  198.851535] drivers/scsi/mvsas/mv_sas.c 2031:notify plug in on phy[0]
[  198.871541] drivers/scsi/mvsas/mv_94xx.c 885:get all reg link rate is 0x111000
[  198.871542] drivers/scsi/mvsas/mv_94xx.c 890:get link rate is 9
[  198.991581] drivers/scsi/mvsas/mv_sas.c 1084:phy 4 attach dev info is 20001
[  198.991583] drivers/scsi/mvsas/mv_sas.c 1086:phy 4 attach sas addr is 4
[  198.991585] drivers/scsi/mvsas/mv_sas.c 277:phy 4 byte dmaded.
[  200.575392] drivers/scsi/mvsas/mv_sas.c 1435:mvs_I_T_nexus_reset for device[1]:rc= 0
[  231.101649] ata8.00: qc timeout (cmd 0xec)
[  231.101655] drivers/scsi/mvsas/mv_sas.c 1545:mvs_abort_task() mvi=ffff880c2c780000 task=ffff88082edf2200 slot=ffff880c2c7a3578 slot_idx=x0
[  231.101659] ata8.00: failed to IDENTIFY (I/O error, err_mask=0x4)
[  231.111758] drivers/scsi/mvsas/mv_sas.c 1980:phy 4 ctrl sts=0x00111000.
[  231.111776] drivers/scsi/mvsas/mv_sas.c 1982:phy 4 irq sts = 0x00000081
[  231.617609] drivers/scsi/mvsas/mv_sas.c 1980:phy 4 ctrl sts=0x00111000.
[  231.617625] drivers/scsi/mvsas/mv_sas.c 1982:phy 4 irq sts = 0x00010000
[  231.617628] drivers/scsi/mvsas/mv_sas.c 2031:notify plug in on phy[0]
[  231.637634] drivers/scsi/mvsas/mv_94xx.c 885:get all reg link rate is 0x111000
[  231.637635] drivers/scsi/mvsas/mv_94xx.c 890:get link rate is 9
[  231.757678] drivers/scsi/mvsas/mv_sas.c 1084:phy 4 attach dev info is 20001
[  231.757680] drivers/scsi/mvsas/mv_sas.c 1086:phy 4 attach sas addr is 4
[  231.757682] drivers/scsi/mvsas/mv_sas.c 277:phy 4 byte dmaded.
[  233.341539] drivers/scsi/mvsas/mv_sas.c 1435:mvs_I_T_nexus_reset for device[1]:rc= 0
[  233.493621] sas: --- Exit sas_scsi_recover_host: busy: 0 failed: 0 tries: 1
[  233.504698] sas: Enter sas_scsi_recover_host busy: 0 failed: 0
[  233.504726] sas: ata7: end_device-7:0: dev error handler
[  233.504740] sas: ata8: end_device-7:1: dev error handler
[  233.504743] sas: ata9: end_device-7:2: dev error handler
[  238.781244] ata9.00: qc timeout (cmd 0xec)
[  238.781250] drivers/scsi/mvsas/mv_sas.c 1545:mvs_abort_task() mvi=ffff880c2c780000 task=ffff88082f7fbf00 slot=ffff880c2c7a3578 slot_idx=x0
[  238.781254] ata9.00: failed to IDENTIFY (I/O error, err_mask=0x4)
[  238.791351] drivers/scsi/mvsas/mv_sas.c 1980:phy 5 ctrl sts=0x00111000.
[  238.791369] drivers/scsi/mvsas/mv_sas.c 1982:phy 5 irq sts = 0x00000081
[  239.309356] drivers/scsi/mvsas/mv_sas.c 1980:phy 5 ctrl sts=0x00111000.
[  239.309372] drivers/scsi/mvsas/mv_sas.c 1982:phy 5 irq sts = 0x00010000
[  239.309375] drivers/scsi/mvsas/mv_sas.c 2031:notify plug in on phy[1]
[  239.329381] drivers/scsi/mvsas/mv_94xx.c 885:get all reg link rate is 0x111000
[  239.329383] drivers/scsi/mvsas/mv_94xx.c 890:get link rate is 9
[  239.449404] drivers/scsi/mvsas/mv_sas.c 1084:phy 5 attach dev info is 20001
[  239.449406] drivers/scsi/mvsas/mv_sas.c 1086:phy 5 attach sas addr is 5
[  239.449413] drivers/scsi/mvsas/mv_sas.c 277:phy 5 byte dmaded.
[  241.021079] drivers/scsi/mvsas/mv_sas.c 1435:mvs_I_T_nexus_reset for device[2]:rc= 0
[  251.580497] ata9.00: qc timeout (cmd 0xec)
[  251.580505] drivers/scsi/mvsas/mv_sas.c 1545:mvs_abort_task() mvi=ffff880c2c780000 task=ffff88082f7fb300 slot=ffff880c2c7a3578 slot_idx=x0
[  251.580512] ata9.00: failed to IDENTIFY (I/O error, err_mask=0x4)
[  251.590631] drivers/scsi/mvsas/mv_sas.c 1980:phy 5 ctrl sts=0x00111000.
[  251.590651] drivers/scsi/mvsas/mv_sas.c 1982:phy 5 irq sts = 0x00000081
[  252.108620] drivers/scsi/mvsas/mv_sas.c 1980:phy 5 ctrl sts=0x00111000.
[  252.108637] drivers/scsi/mvsas/mv_sas.c 1982:phy 5 irq sts = 0x00010000
[  252.108639] drivers/scsi/mvsas/mv_sas.c 2031:notify plug in on phy[1]
[  252.128646] drivers/scsi/mvsas/mv_94xx.c 885:get all reg link rate is 0x111000
[  252.128648] drivers/scsi/mvsas/mv_94xx.c 890:get link rate is 9
[  252.248724] drivers/scsi/mvsas/mv_sas.c 1084:phy 5 attach dev info is 20001
[  252.248726] drivers/scsi/mvsas/mv_sas.c 1086:phy 5 attach sas addr is 5
[  252.248728] drivers/scsi/mvsas/mv_sas.c 277:phy 5 byte dmaded.
[  253.820395] drivers/scsi/mvsas/mv_sas.c 1435:mvs_I_T_nexus_reset for device[2]:rc= 0
[  284.346600] ata9.00: qc timeout (cmd 0xec)
[  284.346608] drivers/scsi/mvsas/mv_sas.c 1545:mvs_abort_task() mvi=ffff880c2c780000 task=ffff88083e208d00 slot=ffff880c2c7a3578 slot_idx=x0
[  284.346615] ata9.00: failed to IDENTIFY (I/O error, err_mask=0x4)
[  284.356719] drivers/scsi/mvsas/mv_sas.c 1980:phy 5 ctrl sts=0x00111000.
[  284.356739] drivers/scsi/mvsas/mv_sas.c 1982:phy 5 irq sts = 0x00000081
[  284.874707] drivers/scsi/mvsas/mv_sas.c 1980:phy 5 ctrl sts=0x00111000.
[  284.874723] drivers/scsi/mvsas/mv_sas.c 1982:phy 5 irq sts = 0x00010000
[  284.874725] drivers/scsi/mvsas/mv_sas.c 2031:notify plug in on phy[1]
[  284.894731] drivers/scsi/mvsas/mv_94xx.c 885:get all reg link rate is 0x111000
[  284.894733] drivers/scsi/mvsas/mv_94xx.c 890:get link rate is 9
[  285.014761] drivers/scsi/mvsas/mv_sas.c 1084:phy 5 attach dev info is 20001
[  285.014763] drivers/scsi/mvsas/mv_sas.c 1086:phy 5 attach sas addr is 5
[  285.014766] drivers/scsi/mvsas/mv_sas.c 277:phy 5 byte dmaded.
[  286.586504] drivers/scsi/mvsas/mv_sas.c 1435:mvs_I_T_nexus_reset for device[2]:rc= 0
[  286.738590] sas: --- Exit sas_scsi_recover_host: busy: 0 failed: 0 tries: 1
[  286.749813] sas: sas_form_port: phy2 belongs to port0 already(1)!
[  286.749817] sas: sas_form_port: phy0 belongs to port1 already(1)!
[  286.749820] sas: sas_form_port: phy1 belongs to port2 already(1)!
[  379.595104] drivers/scsi/mvsas/mv_sas.c 1980:phy 6 ctrl sts=0x00000000.
[  379.595123] drivers/scsi/mvsas/mv_sas.c 1982:phy 6 irq sts = 0x01001001
[  380.095195] drivers/scsi/mvsas/mv_sas.c 1980:phy 4 ctrl sts=0x00000000.
[  380.095198] drivers/scsi/mvsas/mv_sas.c 1982:phy 4 irq sts = 0x01001001
[  380.595234] drivers/scsi/mvsas/mv_sas.c 1980:phy 5 ctrl sts=0x00000000.
[  380.595236] drivers/scsi/mvsas/mv_sas.c 1982:phy 5 irq sts = 0x01001001
[  382.069021] drivers/scsi/mvsas/mv_sas.c 1918:phy2 Removed Device
[  382.069246] ------------[ cut here ]------------
[  382.069261] WARNING: CPU: 23 PID: 3059 at fs/sysfs/group.c:237 sysfs_remove_group+0x9b/0xa0
[  382.069262] sysfs group 'power' not found for kobject 'end_device-7:0'
[  382.069264] Modules linked in: nfsd auth_rpcgss oid_registry lockd grace sunrpc snd_virtuoso snd_oxygen_lib snd_mpu401_uart igb snd_rawmidi snd_seq_device mvsas libsas sp5100_tco amd64_edac_mod edac_core aesni_intel k10temp fam15h_power aes_x86_64 glue_helper lrw gf128mul ablk_helper cryptd input_leds led_class
[  382.069299] CPU: 23 PID: 3059 Comm: kworker/u64:1 Not tainted 4.9.36 #2
[  382.069301] Hardware name: Supermicro H8DG6/H8DGi/H8DG6/H8DGi, BIOS 3.5        11/25/2013
[  382.069313] Workqueue: scsi_wq_7 sas_destruct_devices [libsas]
[  382.069316]  ffffc90009d33c58 ffffffff812f25d6 ffffc90009d33ca8 0000000000000000
[  382.069322]  ffffc90009d33c98 ffffffff81058b0e 000000ed811f06fa 0000000000000000
[  382.069326]  ffffffff81ca0240 ffff88083f85a410 ffff880c2c701fa8 ffff880c2c701f78
[  382.069331] Call Trace:
[  382.069339]  [<ffffffff812f25d6>] dump_stack+0x4d/0x67
[  382.069344]  [<ffffffff81058b0e>] __warn+0xde/0x100
[  382.069347]  [<ffffffff81058b7a>] warn_slowpath_fmt+0x4a/0x50
[  382.069352]  [<ffffffff811f07d8>] ? kernfs_find_and_get_ns+0x48/0x60
[  382.069356]  [<ffffffff811f3f2b>] sysfs_remove_group+0x9b/0xa0
[  382.069361]  [<ffffffff8144b59b>] dpm_sysfs_remove+0x5b/0x70
[  382.069365]  [<ffffffff8143fdc3>] device_del+0x53/0x270
[  382.069369]  [<ffffffff8143ffed>] device_unregister+0xd/0x20
[  382.069374]  [<ffffffff812e8709>] bsg_unregister_queue+0x59/0xa0
[  382.069379]  [<ffffffff8147a609>] sas_rphy_remove+0x49/0x80
[  382.069383]  [<ffffffff8147ca5d>] sas_rphy_delete+0xd/0x20
[  382.069391]  [<ffffffffa0e546a1>] sas_destruct_devices+0x61/0x90 [libsas]
[  382.069396]  [<ffffffff8107114f>] process_one_work+0x14f/0x400
[  382.069400]  [<ffffffff81071766>] worker_thread+0x46/0x470
[  382.069403]  [<ffffffff81071720>] ? rescuer_thread+0x320/0x320
[  382.069408]  [<ffffffff81076662>] kthread+0xd2/0xf0
[  382.069412]  [<ffffffff81076590>] ? kthread_park+0x70/0x70
[  382.069418]  [<ffffffff817225c2>] ret_from_fork+0x22/0x30
[  382.069420] ---[ end trace 5c901a33e742b9c5 ]---
[  382.069519] ------------[ cut here ]------------
[  382.069525] WARNING: CPU: 23 PID: 3059 at fs/sysfs/group.c:237 sysfs_remove_group+0x9b/0xa0
[  382.069526] sysfs group 'power' not found for kobject 'end_device-7:0'
[  382.069527] Modules linked in: nfsd auth_rpcgss oid_registry lockd grace sunrpc snd_virtuoso snd_oxygen_lib snd_mpu401_uart igb snd_rawmidi snd_seq_device mvsas libsas sp5100_tco amd64_edac_mod edac_core aesni_intel k10temp fam15h_power aes_x86_64 glue_helper lrw gf128mul ablk_helper cryptd input_leds led_class
[  382.069551] CPU: 23 PID: 3059 Comm: kworker/u64:1 Tainted: G        W       4.9.36 #2
[  382.069553] Hardware name: Supermicro H8DG6/H8DGi/H8DG6/H8DGi, BIOS 3.5        11/25/2013
[  382.069559] Workqueue: scsi_wq_7 sas_destruct_devices [libsas]
[  382.069562]  ffffc90009d33c00 ffffffff812f25d6 ffffc90009d33c50 0000000000000000
[  382.069566]  ffffc90009d33c40 ffffffff81058b0e 000000ed811f06fa 0000000000000000
[  382.069571]  ffffffff81ca0240 ffff880c3f851c38 ffff880c2c701fa8 ffff880c2c701f78
[  382.069575] Call Trace:
[  382.069579]  [<ffffffff812f25d6>] dump_stack+0x4d/0x67
[  382.069583]  [<ffffffff81058b0e>] __warn+0xde/0x100
[  382.069586]  [<ffffffff81058b7a>] warn_slowpath_fmt+0x4a/0x50
[  382.069590]  [<ffffffff811f07d8>] ? kernfs_find_and_get_ns+0x48/0x60
[  382.069594]  [<ffffffff812f59e0>] ? cleanup_uevent_env+0x10/0x10
[  382.069598]  [<ffffffff811f3f2b>] sysfs_remove_group+0x9b/0xa0
[  382.069601]  [<ffffffff8144b59b>] dpm_sysfs_remove+0x5b/0x70
[  382.069604]  [<ffffffff8143fdc3>] device_del+0x53/0x270
[  382.069607]  [<ffffffff8143f564>] ? device_remove_file+0x14/0x20
[  382.069612]  [<ffffffff81448435>] attribute_container_class_device_del+0x15/0x20
[  382.069615]  [<ffffffff81448614>] transport_remove_classdev+0x54/0x70
[  382.069619]  [<ffffffff814485c0>] ? transport_add_class_device+0x40/0x40
[  382.069622]  [<ffffffff8144807b>] attribute_container_device_trigger+0xab/0xb0
[  382.069626]  [<ffffffff81448570>] transport_remove_device+0x10/0x20
[  382.069629]  [<ffffffff8147a611>] sas_rphy_remove+0x51/0x80
[  382.069633]  [<ffffffff8147ca5d>] sas_rphy_delete+0xd/0x20
[  382.069641]  [<ffffffffa0e546a1>] sas_destruct_devices+0x61/0x90 [libsas]
[  382.069644]  [<ffffffff8107114f>] process_one_work+0x14f/0x400
[  382.069648]  [<ffffffff81071766>] worker_thread+0x46/0x470
[  382.069652]  [<ffffffff81071720>] ? rescuer_thread+0x320/0x320
[  382.069656]  [<ffffffff81076662>] kthread+0xd2/0xf0
[  382.069660]  [<ffffffff81076590>] ? kthread_park+0x70/0x70
[  382.069663]  [<ffffffff817225c2>] ret_from_fork+0x22/0x30
[  382.069666] ---[ end trace 5c901a33e742b9c6 ]---
[  382.069684] ------------[ cut here ]------------
[  382.069688] WARNING: CPU: 23 PID: 3059 at fs/sysfs/group.c:237 sysfs_remove_group+0x9b/0xa0
[  382.069690] sysfs group 'power' not found for kobject 'end_device-7:0'
[  382.069691] Modules linked in: nfsd auth_rpcgss oid_registry lockd grace sunrpc snd_virtuoso snd_oxygen_lib snd_mpu401_uart igb snd_rawmidi snd_seq_device mvsas libsas sp5100_tco amd64_edac_mod edac_core aesni_intel k10temp fam15h_power aes_x86_64 glue_helper lrw gf128mul ablk_helper cryptd input_leds led_class
[  382.069715] CPU: 23 PID: 3059 Comm: kworker/u64:1 Tainted: G        W       4.9.36 #2
[  382.069716] Hardware name: Supermicro H8DG6/H8DGi/H8DG6/H8DGi, BIOS 3.5        11/25/2013
[  382.069722] Workqueue: scsi_wq_7 sas_destruct_devices [libsas]
[  382.069725]  ffffc90009d33c00 ffffffff812f25d6 ffffc90009d33c50 0000000000000000
[  382.069729]  ffffc90009d33c40 ffffffff81058b0e 000000ed811f06fa 0000000000000000
[  382.069733]  ffffffff81ca0240 ffff880c3f851438 ffff880c2c701fa8 ffff880c2c701f78
[  382.069737] Call Trace:
[  382.069741]  [<ffffffff812f25d6>] dump_stack+0x4d/0x67
[  382.069744]  [<ffffffff81058b0e>] __warn+0xde/0x100
[  382.069748]  [<ffffffff81058b7a>] warn_slowpath_fmt+0x4a/0x50
[  382.069751]  [<ffffffff811f07d8>] ? kernfs_find_and_get_ns+0x48/0x60
[  382.069755]  [<ffffffff812f59e0>] ? cleanup_uevent_env+0x10/0x10
[  382.069759]  [<ffffffff811f3f2b>] sysfs_remove_group+0x9b/0xa0
[  382.069762]  [<ffffffff8144b59b>] dpm_sysfs_remove+0x5b/0x70
[  382.069765]  [<ffffffff8143fdc3>] device_del+0x53/0x270
[  382.069768]  [<ffffffff8143f564>] ? device_remove_file+0x14/0x20
[  382.069772]  [<ffffffff81448435>] attribute_container_class_device_del+0x15/0x20
[  382.069776]  [<ffffffff81448614>] transport_remove_classdev+0x54/0x70
[  382.069779]  [<ffffffff814485c0>] ? transport_add_class_device+0x40/0x40
[  382.069783]  [<ffffffff8144807b>] attribute_container_device_trigger+0xab/0xb0
[  382.069786]  [<ffffffff81448570>] transport_remove_device+0x10/0x20
[  382.069790]  [<ffffffff8147a611>] sas_rphy_remove+0x51/0x80
[  382.069794]  [<ffffffff8147ca5d>] sas_rphy_delete+0xd/0x20
[  382.069801]  [<ffffffffa0e546a1>] sas_destruct_devices+0x61/0x90 [libsas]
[  382.069805]  [<ffffffff8107114f>] process_one_work+0x14f/0x400
[  382.069808]  [<ffffffff81071766>] worker_thread+0x46/0x470
[  382.069812]  [<ffffffff81071720>] ? rescuer_thread+0x320/0x320
[  382.069816]  [<ffffffff81076662>] kthread+0xd2/0xf0
[  382.069820]  [<ffffffff81076590>] ? kthread_park+0x70/0x70
[  382.069824]  [<ffffffff817225c2>] ret_from_fork+0x22/0x30
[  382.069826] ---[ end trace 5c901a33e742b9c7 ]---
[  382.069842] ------------[ cut here ]------------
[  382.069846] WARNING: CPU: 23 PID: 3059 at fs/sysfs/group.c:237 sysfs_remove_group+0x9b/0xa0
[  382.069848] sysfs group 'power' not found for kobject 'end_device-7:0'
[  382.069849] Modules linked in: nfsd auth_rpcgss oid_registry lockd grace sunrpc snd_virtuoso snd_oxygen_lib snd_mpu401_uart igb snd_rawmidi snd_seq_device mvsas libsas sp5100_tco amd64_edac_mod edac_core aesni_intel k10temp fam15h_power aes_x86_64 glue_helper lrw gf128mul ablk_helper cryptd input_leds led_class
[  382.069872] CPU: 23 PID: 3059 Comm: kworker/u64:1 Tainted: G        W       4.9.36 #2
[  382.069873] Hardware name: Supermicro H8DG6/H8DGi/H8DG6/H8DGi, BIOS 3.5        11/25/2013
[  382.069880] Workqueue: scsi_wq_7 sas_destruct_devices [libsas]
[  382.069882]  ffffc90009d33c88 ffffffff812f25d6 ffffc90009d33cd8 0000000000000000
[  382.069886]  ffffc90009d33cc8 ffffffff81058b0e 000000ed811f06fa 0000000000000000
[  382.069890]  ffffffff81ca0240 ffff880c2f4e5810 ffff880c2c701fa8 ffff880c2c701f78
[  382.069894] Call Trace:
[  382.069898]  [<ffffffff812f25d6>] dump_stack+0x4d/0x67
[  382.069901]  [<ffffffff81058b0e>] __warn+0xde/0x100
[  382.069905]  [<ffffffff81058b7a>] warn_slowpath_fmt+0x4a/0x50
[  382.069908]  [<ffffffff811f07d8>] ? kernfs_find_and_get_ns+0x48/0x60
[  382.069912]  [<ffffffff812f59e0>] ? cleanup_uevent_env+0x10/0x10
[  382.069916]  [<ffffffff811f3f2b>] sysfs_remove_group+0x9b/0xa0
[  382.069919]  [<ffffffff8144b59b>] dpm_sysfs_remove+0x5b/0x70
[  382.069922]  [<ffffffff8143fdc3>] device_del+0x53/0x270
[  382.069926]  [<ffffffff8147a619>] sas_rphy_remove+0x59/0x80
[  382.069930]  [<ffffffff8147ca5d>] sas_rphy_delete+0xd/0x20
[  382.069937]  [<ffffffffa0e546a1>] sas_destruct_devices+0x61/0x90 [libsas]
[  382.069941]  [<ffffffff8107114f>] process_one_work+0x14f/0x400
[  382.069948]  [<ffffffff81071766>] worker_thread+0x46/0x470
[  382.069951]  [<ffffffff81071720>] ? rescuer_thread+0x320/0x320
[  382.069955]  [<ffffffff81076662>] kthread+0xd2/0xf0
[  382.069972]  [<ffffffff81076590>] ? kthread_park+0x70/0x70
[  382.069987]  [<ffffffff817225c2>] ret_from_fork+0x22/0x30
[  382.070021] ---[ end trace 5c901a33e742b9c8 ]---
[  382.070032] drivers/scsi/mvsas/mv_sas.c 1262:found dev[0:5] is gone.
[  382.645025] drivers/scsi/mvsas/mv_sas.c 1918:phy0 Removed Device
[  382.645239] ------------[ cut here ]------------
[  382.645248] WARNING: CPU: 18 PID: 3059 at fs/sysfs/group.c:237 sysfs_remove_group+0x9b/0xa0
[  382.645250] sysfs group 'power' not found for kobject 'end_device-7:1'
[  382.645251] Modules linked in: nfsd auth_rpcgss oid_registry lockd grace sunrpc snd_virtuoso snd_oxygen_lib snd_mpu401_uart igb snd_rawmidi snd_seq_device mvsas libsas sp5100_tco amd64_edac_mod edac_core aesni_intel k10temp fam15h_power aes_x86_64 glue_helper lrw gf128mul ablk_helper cryptd input_leds led_class
[  382.645281] CPU: 18 PID: 3059 Comm: kworker/u64:1 Tainted: G        W       4.9.36 #2
[  382.645282] Hardware name: Supermicro H8DG6/H8DGi/H8DG6/H8DGi, BIOS 3.5        11/25/2013
[  382.645291] Workqueue: scsi_wq_7 sas_destruct_devices [libsas]
[  382.645294]  ffffc90009d33c58 ffffffff812f25d6 ffffc90009d33ca8 0000000000000000
[  382.645300]  ffffc90009d33c98 ffffffff81058b0e 000000ed811f06fa 0000000000000000
[  382.645304]  ffffffff81ca0240 ffff88083f849410 ffff880c2c702268 ffff880c2c702238
[  382.645309] Call Trace:
[  382.645315]  [<ffffffff812f25d6>] dump_stack+0x4d/0x67
[  382.645319]  [<ffffffff81058b0e>] __warn+0xde/0x100
[  382.645322]  [<ffffffff81058b7a>] warn_slowpath_fmt+0x4a/0x50
[  382.645326]  [<ffffffff811f07d8>] ? kernfs_find_and_get_ns+0x48/0x60
[  382.645330]  [<ffffffff811f3f2b>] sysfs_remove_group+0x9b/0xa0
[  382.645334]  [<ffffffff8144b59b>] dpm_sysfs_remove+0x5b/0x70
[  382.645337]  [<ffffffff8143fdc3>] device_del+0x53/0x270
[  382.645341]  [<ffffffff8143ffed>] device_unregister+0xd/0x20
[  382.645345]  [<ffffffff812e8709>] bsg_unregister_queue+0x59/0xa0
[  382.645350]  [<ffffffff8147a609>] sas_rphy_remove+0x49/0x80
[  382.645354]  [<ffffffff8147ca5d>] sas_rphy_delete+0xd/0x20
[  382.645361]  [<ffffffffa0e546a1>] sas_destruct_devices+0x61/0x90 [libsas]
[  382.645366]  [<ffffffff8107114f>] process_one_work+0x14f/0x400
[  382.645369]  [<ffffffff81071766>] worker_thread+0x46/0x470
[  382.645373]  [<ffffffff81071720>] ? rescuer_thread+0x320/0x320
[  382.645377]  [<ffffffff81076662>] kthread+0xd2/0xf0
[  382.645381]  [<ffffffff81076590>] ? kthread_park+0x70/0x70
[  382.645386]  [<ffffffff817225c2>] ret_from_fork+0x22/0x30
[  382.645388] ---[ end trace 5c901a33e742b9c9 ]---
[  382.645462] ------------[ cut here ]------------
[  382.645468] WARNING: CPU: 18 PID: 3059 at fs/sysfs/group.c:237 sysfs_remove_group+0x9b/0xa0
[  382.645469] sysfs group 'power' not found for kobject 'end_device-7:1'
[  382.645470] Modules linked in: nfsd auth_rpcgss oid_registry lockd grace sunrpc snd_virtuoso snd_oxygen_lib snd_mpu401_uart igb snd_rawmidi snd_seq_device mvsas libsas sp5100_tco amd64_edac_mod edac_core aesni_intel k10temp fam15h_power aes_x86_64 glue_helper lrw gf128mul ablk_helper cryptd input_leds led_class
[  382.645495] CPU: 18 PID: 3059 Comm: kworker/u64:1 Tainted: G        W       4.9.36 #2
[  382.645496] Hardware name: Supermicro H8DG6/H8DGi/H8DG6/H8DGi, BIOS 3.5        11/25/2013
[  382.645503] Workqueue: scsi_wq_7 sas_destruct_devices [libsas]
[  382.645506]  ffffc90009d33c00 ffffffff812f25d6 ffffc90009d33c50 0000000000000000
[  382.645510]  ffffc90009d33c40 ffffffff81058b0e 000000ed811f06fa 0000000000000000
[  382.645515]  ffffffff81ca0240 ffff880c2f4e7438 ffff880c2c702268 ffff880c2c702238
[  382.645519] Call Trace:
[  382.645524]  [<ffffffff812f25d6>] dump_stack+0x4d/0x67
[  382.645527]  [<ffffffff81058b0e>] __warn+0xde/0x100
[  382.645530]  [<ffffffff81058b7a>] warn_slowpath_fmt+0x4a/0x50
[  382.645534]  [<ffffffff811f07d8>] ? kernfs_find_and_get_ns+0x48/0x60
[  382.645538]  [<ffffffff812f59e0>] ? cleanup_uevent_env+0x10/0x10
[  382.645542]  [<ffffffff811f3f2b>] sysfs_remove_group+0x9b/0xa0
[  382.645544]  [<ffffffff8144b59b>] dpm_sysfs_remove+0x5b/0x70
[  382.645548]  [<ffffffff8143fdc3>] device_del+0x53/0x270
[  382.645551]  [<ffffffff8143f564>] ? device_remove_file+0x14/0x20
[  382.645555]  [<ffffffff81448435>] attribute_container_class_device_del+0x15/0x20
[  382.645559]  [<ffffffff81448614>] transport_remove_classdev+0x54/0x70
[  382.645562]  [<ffffffff814485c0>] ? transport_add_class_device+0x40/0x40
[  382.645566]  [<ffffffff8144807b>] attribute_container_device_trigger+0xab/0xb0
[  382.645569]  [<ffffffff81448570>] transport_remove_device+0x10/0x20
[  382.645573]  [<ffffffff8147a611>] sas_rphy_remove+0x51/0x80
[  382.645576]  [<ffffffff8147ca5d>] sas_rphy_delete+0xd/0x20
[  382.645584]  [<ffffffffa0e546a1>] sas_destruct_devices+0x61/0x90 [libsas]
[  382.645588]  [<ffffffff8107114f>] process_one_work+0x14f/0x400
[  382.645591]  [<ffffffff81071766>] worker_thread+0x46/0x470
[  382.645595]  [<ffffffff81071720>] ? rescuer_thread+0x320/0x320
[  382.645599]  [<ffffffff81076662>] kthread+0xd2/0xf0
[  382.645603]  [<ffffffff81076590>] ? kthread_park+0x70/0x70
[  382.645607]  [<ffffffff817225c2>] ret_from_fork+0x22/0x30
[  382.645609] ---[ end trace 5c901a33e742b9ca ]---
[  382.645626] ------------[ cut here ]------------
[  382.645631] WARNING: CPU: 18 PID: 3059 at fs/sysfs/group.c:237 sysfs_remove_group+0x9b/0xa0
[  382.645632] sysfs group 'power' not found for kobject 'end_device-7:1'
[  382.645633] Modules linked in: nfsd auth_rpcgss oid_registry lockd grace sunrpc snd_virtuoso snd_oxygen_lib snd_mpu401_uart igb snd_rawmidi snd_seq_device mvsas libsas sp5100_tco amd64_edac_mod edac_core aesni_intel k10temp fam15h_power aes_x86_64 glue_helper lrw gf128mul ablk_helper cryptd input_leds led_class
[  382.645657] CPU: 18 PID: 3059 Comm: kworker/u64:1 Tainted: G        W       4.9.36 #2
[  382.645659] Hardware name: Supermicro H8DG6/H8DGi/H8DG6/H8DGi, BIOS 3.5        11/25/2013
[  382.645665] Workqueue: scsi_wq_7 sas_destruct_devices [libsas]
[  382.645667]  ffffc90009d33c00 ffffffff812f25d6 ffffc90009d33c50 0000000000000000
[  382.645672]  ffffc90009d33c40 ffffffff81058b0e 000000ed811f06fa 0000000000000000
[  382.645676]  ffffffff81ca0240 ffff880c2f4e7038 ffff880c2c702268 ffff880c2c702238
[  382.645680] Call Trace:
[  382.645684]  [<ffffffff812f25d6>] dump_stack+0x4d/0x67
[  382.645687]  [<ffffffff81058b0e>] __warn+0xde/0x100
[  382.645691]  [<ffffffff81058b7a>] warn_slowpath_fmt+0x4a/0x50
[  382.645694]  [<ffffffff811f07d8>] ? kernfs_find_and_get_ns+0x48/0x60
[  382.645698]  [<ffffffff812f59e0>] ? cleanup_uevent_env+0x10/0x10
[  382.645702]  [<ffffffff811f3f2b>] sysfs_remove_group+0x9b/0xa0
[  382.645705]  [<ffffffff8144b59b>] dpm_sysfs_remove+0x5b/0x70
[  382.645708]  [<ffffffff8143fdc3>] device_del+0x53/0x270
[  382.645711]  [<ffffffff8143f564>] ? device_remove_file+0x14/0x20
[  382.645715]  [<ffffffff81448435>] attribute_container_class_device_del+0x15/0x20
[  382.645719]  [<ffffffff81448614>] transport_remove_classdev+0x54/0x70
[  382.645722]  [<ffffffff814485c0>] ? transport_add_class_device+0x40/0x40
[  382.645746]  [<ffffffff8144807b>] attribute_container_device_trigger+0xab/0xb0
[  382.645758]  [<ffffffff81448570>] transport_remove_device+0x10/0x20
[  382.645768]  [<ffffffff8147a611>] sas_rphy_remove+0x51/0x80
[  382.645778]  [<ffffffff8147ca5d>] sas_rphy_delete+0xd/0x20
[  382.645789]  [<ffffffffa0e546a1>] sas_destruct_devices+0x61/0x90 [libsas]
[  382.645800]  [<ffffffff8107114f>] process_one_work+0x14f/0x400
[  382.645811]  [<ffffffff81071766>] worker_thread+0x46/0x470
[  382.645820]  [<ffffffff81071720>] ? rescuer_thread+0x320/0x320
[  382.645829]  [<ffffffff81076662>] kthread+0xd2/0xf0
[  382.645839]  [<ffffffff81076590>] ? kthread_park+0x70/0x70
[  382.645850]  [<ffffffff817225c2>] ret_from_fork+0x22/0x30
[  382.645857] ---[ end trace 5c901a33e742b9cb ]---
[  382.645879] ------------[ cut here ]------------
[  382.645883] WARNING: CPU: 18 PID: 3059 at fs/sysfs/group.c:237 sysfs_remove_group+0x9b/0xa0
[  382.645898] sysfs group 'power' not found for kobject 'end_device-7:1'
[  382.645898] Modules linked in: nfsd auth_rpcgss oid_registry lockd grace sunrpc snd_virtuoso snd_oxygen_lib snd_mpu401_uart igb snd_rawmidi snd_seq_device mvsas libsas sp5100_tco amd64_edac_mod edac_core aesni_intel k10temp fam15h_power aes_x86_64 glue_helper lrw gf128mul ablk_helper cryptd input_leds led_class
[  382.645929] CPU: 18 PID: 3059 Comm: kworker/u64:1 Tainted: G        W       4.9.36 #2
[  382.645931] Hardware name: Supermicro H8DG6/H8DGi/H8DG6/H8DGi, BIOS 3.5        11/25/2013
[  382.645939] Workqueue: scsi_wq_7 sas_destruct_devices [libsas]
[  382.645942]  ffffc90009d33c88 ffffffff812f25d6 ffffc90009d33cd8 0000000000000000
[  382.645947]  ffffc90009d33cc8 ffffffff81058b0e 000000ed811f06fa 0000000000000000
[  382.645952]  ffffffff81ca0240 ffff880c3f851810 ffff880c2c702268 ffff880c2c702238
[  382.645958] Call Trace:
[  382.645963]  [<ffffffff812f25d6>] dump_stack+0x4d/0x67
[  382.645967]  [<ffffffff81058b0e>] __warn+0xde/0x100
[  382.645971]  [<ffffffff81058b7a>] warn_slowpath_fmt+0x4a/0x50
[  382.645975]  [<ffffffff811f07d8>] ? kernfs_find_and_get_ns+0x48/0x60
[  382.645978]  [<ffffffff812f59e0>] ? cleanup_uevent_env+0x10/0x10
[  382.645982]  [<ffffffff811f3f2b>] sysfs_remove_group+0x9b/0xa0
[  382.645985]  [<ffffffff8144b59b>] dpm_sysfs_remove+0x5b/0x70
[  382.645988]  [<ffffffff8143fdc3>] device_del+0x53/0x270
[  382.645992]  [<ffffffff8147a619>] sas_rphy_remove+0x59/0x80
[  382.645996]  [<ffffffff8147ca5d>] sas_rphy_delete+0xd/0x20
[  382.646003]  [<ffffffffa0e546a1>] sas_destruct_devices+0x61/0x90 [libsas]
[  382.646007]  [<ffffffff8107114f>] process_one_work+0x14f/0x400
[  382.646010]  [<ffffffff81071766>] worker_thread+0x46/0x470
[  382.646013]  [<ffffffff81071720>] ? rescuer_thread+0x320/0x320
[  382.646017]  [<ffffffff81076662>] kthread+0xd2/0xf0
[  382.646021]  [<ffffffff81076590>] ? kthread_park+0x70/0x70
[  382.646025]  [<ffffffff817225c2>] ret_from_fork+0x22/0x30
[  382.646027] ---[ end trace 5c901a33e742b9cc ]---
[  382.646037] drivers/scsi/mvsas/mv_sas.c 1262:found dev[1:5] is gone.
[  383.156972] drivers/scsi/mvsas/mv_sas.c 1918:phy1 Removed Device
[  383.157173] ------------[ cut here ]------------
[  383.157183] WARNING: CPU: 23 PID: 3059 at fs/sysfs/group.c:237 sysfs_remove_group+0x9b/0xa0
[  383.157184] sysfs group 'power' not found for kobject 'end_device-7:2'
[  383.157185] Modules linked in: nfsd auth_rpcgss oid_registry lockd grace sunrpc snd_virtuoso snd_oxygen_lib snd_mpu401_uart igb snd_rawmidi snd_seq_device mvsas libsas sp5100_tco amd64_edac_mod edac_core aesni_intel k10temp fam15h_power aes_x86_64 glue_helper lrw gf128mul ablk_helper cryptd input_leds led_class
[  383.157214] CPU: 23 PID: 3059 Comm: kworker/u64:1 Tainted: G        W       4.9.36 #2
[  383.157216] Hardware name: Supermicro H8DG6/H8DGi/H8DG6/H8DGi, BIOS 3.5        11/25/2013
[  383.157225] Workqueue: scsi_wq_7 sas_destruct_devices [libsas]
[  383.157228]  ffffc90009d33c58 ffffffff812f25d6 ffffc90009d33ca8 0000000000000000
[  383.157233]  ffffc90009d33c98 ffffffff81058b0e 000000ed811f06fa 0000000000000000
[  383.157237]  ffffffff81ca0240 ffff88082f541410 ffff880c2c702528 ffff880c2c7024f8
[  383.157242] Call Trace:
[  383.157247]  [<ffffffff812f25d6>] dump_stack+0x4d/0x67
[  383.157251]  [<ffffffff81058b0e>] __warn+0xde/0x100
[  383.157255]  [<ffffffff81058b7a>] warn_slowpath_fmt+0x4a/0x50
[  383.157259]  [<ffffffff811f07d8>] ? kernfs_find_and_get_ns+0x48/0x60
[  383.157263]  [<ffffffff811f3f2b>] sysfs_remove_group+0x9b/0xa0
[  383.157266]  [<ffffffff8144b59b>] dpm_sysfs_remove+0x5b/0x70
[  383.157270]  [<ffffffff8143fdc3>] device_del+0x53/0x270
[  383.157273]  [<ffffffff8143ffed>] device_unregister+0xd/0x20
[  383.157278]  [<ffffffff812e8709>] bsg_unregister_queue+0x59/0xa0
[  383.157282]  [<ffffffff8147a609>] sas_rphy_remove+0x49/0x80
[  383.157286]  [<ffffffff8147ca5d>] sas_rphy_delete+0xd/0x20
[  383.157294]  [<ffffffffa0e546a1>] sas_destruct_devices+0x61/0x90 [libsas]
[  383.157298]  [<ffffffff8107114f>] process_one_work+0x14f/0x400
[  383.157301]  [<ffffffff81071766>] worker_thread+0x46/0x470
[  383.157305]  [<ffffffff81071720>] ? rescuer_thread+0x320/0x320
[  383.157309]  [<ffffffff81076662>] kthread+0xd2/0xf0
[  383.157313]  [<ffffffff81076590>] ? kthread_park+0x70/0x70
[  383.157317]  [<ffffffff817225c2>] ret_from_fork+0x22/0x30
[  383.157320] ---[ end trace 5c901a33e742b9cd ]---
[  383.157405] ------------[ cut here ]------------
[  383.157410] WARNING: CPU: 23 PID: 3059 at fs/sysfs/group.c:237 sysfs_remove_group+0x9b/0xa0
[  383.157411] sysfs group 'power' not found for kobject 'end_device-7:2'
[  383.157412] Modules linked in: nfsd auth_rpcgss oid_registry lockd grace sunrpc snd_virtuoso snd_oxygen_lib snd_mpu401_uart igb snd_rawmidi snd_seq_device mvsas libsas sp5100_tco amd64_edac_mod edac_core aesni_intel k10temp fam15h_power aes_x86_64 glue_helper lrw gf128mul ablk_helper cryptd input_leds led_class
[  383.157437] CPU: 23 PID: 3059 Comm: kworker/u64:1 Tainted: G        W       4.9.36 #2
[  383.157438] Hardware name: Supermicro H8DG6/H8DGi/H8DG6/H8DGi, BIOS 3.5        11/25/2013
[  383.157445] Workqueue: scsi_wq_7 sas_destruct_devices [libsas]
[  383.157447]  ffffc90009d33c00 ffffffff812f25d6 ffffc90009d33c50 0000000000000000
[  383.157452]  ffffc90009d33c40 ffffffff81058b0e 000000ed811f06fa 0000000000000000
[  383.157456]  ffffffff81ca0240 ffff880c2e0dcc38 ffff880c2c702528 ffff880c2c7024f8
[  383.157460] Call Trace:
[  383.157464]  [<ffffffff812f25d6>] dump_stack+0x4d/0x67
[  383.157468]  [<ffffffff81058b0e>] __warn+0xde/0x100
[  383.157471]  [<ffffffff81058b7a>] warn_slowpath_fmt+0x4a/0x50
[  383.157475]  [<ffffffff811f07d8>] ? kernfs_find_and_get_ns+0x48/0x60
[  383.157479]  [<ffffffff812f59e0>] ? cleanup_uevent_env+0x10/0x10
[  383.157482]  [<ffffffff811f3f2b>] sysfs_remove_group+0x9b/0xa0
[  383.157485]  [<ffffffff8144b59b>] dpm_sysfs_remove+0x5b/0x70
[  383.157489]  [<ffffffff8143fdc3>] device_del+0x53/0x270
[  383.157492]  [<ffffffff8143f564>] ? device_remove_file+0x14/0x20
[  383.157496]  [<ffffffff81448435>] attribute_container_class_device_del+0x15/0x20
[  383.157499]  [<ffffffff81448614>] transport_remove_classdev+0x54/0x70
[  383.157503]  [<ffffffff814485c0>] ? transport_add_class_device+0x40/0x40
[  383.157506]  [<ffffffff8144807b>] attribute_container_device_trigger+0xab/0xb0
[  383.157509]  [<ffffffff81448570>] transport_remove_device+0x10/0x20
[  383.157513]  [<ffffffff8147a611>] sas_rphy_remove+0x51/0x80
[  383.157517]  [<ffffffff8147ca5d>] sas_rphy_delete+0xd/0x20
[  383.157524]  [<ffffffffa0e546a1>] sas_destruct_devices+0x61/0x90 [libsas]
[  383.157528]  [<ffffffff8107114f>] process_one_work+0x14f/0x400
[  383.157531]  [<ffffffff81071766>] worker_thread+0x46/0x470
[  383.157535]  [<ffffffff81071720>] ? rescuer_thread+0x320/0x320
[  383.157539]  [<ffffffff81076662>] kthread+0xd2/0xf0
[  383.157543]  [<ffffffff81076590>] ? kthread_park+0x70/0x70
[  383.157547]  [<ffffffff817225c2>] ret_from_fork+0x22/0x30
[  383.157549] ---[ end trace 5c901a33e742b9ce ]---
[  383.157566] ------------[ cut here ]------------
[  383.157571] WARNING: CPU: 23 PID: 3059 at fs/sysfs/group.c:237 sysfs_remove_group+0x9b/0xa0
[  383.157572] sysfs group 'power' not found for kobject 'end_device-7:2'
[  383.157573] Modules linked in: nfsd auth_rpcgss oid_registry lockd grace sunrpc snd_virtuoso snd_oxygen_lib snd_mpu401_uart igb snd_rawmidi snd_seq_device mvsas libsas sp5100_tco amd64_edac_mod edac_core aesni_intel k10temp fam15h_power aes_x86_64 glue_helper lrw gf128mul ablk_helper cryptd input_leds led_class
[  383.157597] CPU: 23 PID: 3059 Comm: kworker/u64:1 Tainted: G        W       4.9.36 #2
[  383.157598] Hardware name: Supermicro H8DG6/H8DGi/H8DG6/H8DGi, BIOS 3.5        11/25/2013
[  383.157605] Workqueue: scsi_wq_7 sas_destruct_devices [libsas]
[  383.157607]  ffffc90009d33c00 ffffffff812f25d6 ffffc90009d33c50 0000000000000000
[  383.157611]  ffffc90009d33c40 ffffffff81058b0e 000000ed811f06fa 0000000000000000
[  383.157615]  ffffffff81ca0240 ffff880c2e0dc438 ffff880c2c702528 ffff880c2c7024f8
[  383.157619] Call Trace:
[  383.157623]  [<ffffffff812f25d6>] dump_stack+0x4d/0x67
[  383.157626]  [<ffffffff81058b0e>] __warn+0xde/0x100
[  383.157629]  [<ffffffff81058b7a>] warn_slowpath_fmt+0x4a/0x50
[  383.157633]  [<ffffffff811f07d8>] ? kernfs_find_and_get_ns+0x48/0x60
[  383.157637]  [<ffffffff812f59e0>] ? cleanup_uevent_env+0x10/0x10
[  383.157640]  [<ffffffff811f3f2b>] sysfs_remove_group+0x9b/0xa0
[  383.157643]  [<ffffffff8144b59b>] dpm_sysfs_remove+0x5b/0x70
[  383.157647]  [<ffffffff8143fdc3>] device_del+0x53/0x270
[  383.157650]  [<ffffffff8143f564>] ? device_remove_file+0x14/0x20
[  383.157653]  [<ffffffff81448435>] attribute_container_class_device_del+0x15/0x20
[  383.157657]  [<ffffffff81448614>] transport_remove_classdev+0x54/0x70
[  383.157660]  [<ffffffff814485c0>] ? transport_add_class_device+0x40/0x40
[  383.157664]  [<ffffffff8144807b>] attribute_container_device_trigger+0xab/0xb0
[  383.157667]  [<ffffffff81448570>] transport_remove_device+0x10/0x20
[  383.157671]  [<ffffffff8147a611>] sas_rphy_remove+0x51/0x80
[  383.157675]  [<ffffffff8147ca5d>] sas_rphy_delete+0xd/0x20
[  383.157682]  [<ffffffffa0e546a1>] sas_destruct_devices+0x61/0x90 [libsas]
[  383.157686]  [<ffffffff8107114f>] process_one_work+0x14f/0x400
[  383.157689]  [<ffffffff81071766>] worker_thread+0x46/0x470
[  383.157693]  [<ffffffff81071720>] ? rescuer_thread+0x320/0x320
[  383.157697]  [<ffffffff81076662>] kthread+0xd2/0xf0
[  383.157701]  [<ffffffff81076590>] ? kthread_park+0x70/0x70
[  383.157704]  [<ffffffff817225c2>] ret_from_fork+0x22/0x30
[  383.157706] ---[ end trace 5c901a33e742b9cf ]---
[  383.157726] ------------[ cut here ]------------
[  383.157731] WARNING: CPU: 23 PID: 3059 at fs/sysfs/group.c:237 sysfs_remove_group+0x9b/0xa0
[  383.157732] sysfs group 'power' not found for kobject 'end_device-7:2'
[  383.157733] Modules linked in: nfsd auth_rpcgss oid_registry lockd grace sunrpc snd_virtuoso snd_oxygen_lib snd_mpu401_uart igb snd_rawmidi snd_seq_device mvsas libsas sp5100_tco amd64_edac_mod edac_core aesni_intel k10temp fam15h_power aes_x86_64 glue_helper lrw gf128mul ablk_helper cryptd input_leds led_class
[  383.157756] CPU: 23 PID: 3059 Comm: kworker/u64:1 Tainted: G        W       4.9.36 #2
[  383.157757] Hardware name: Supermicro H8DG6/H8DGi/H8DG6/H8DGi, BIOS 3.5        11/25/2013
[  383.157764] Workqueue: scsi_wq_7 sas_destruct_devices [libsas]
[  383.157766]  ffffc90009d33c88 ffffffff812f25d6 ffffc90009d33cd8 0000000000000000
[  383.157770]  ffffc90009d33cc8 ffffffff81058b0e 000000ed811f06fa 0000000000000000
[  383.157774]  ffffffff81ca0240 ffff880c3f83f810 ffff880c2c702528 ffff880c2c7024f8
[  383.157778] Call Trace:
[  383.157782]  [<ffffffff812f25d6>] dump_stack+0x4d/0x67
[  383.157785]  [<ffffffff81058b0e>] __warn+0xde/0x100
[  383.157789]  [<ffffffff81058b7a>] warn_slowpath_fmt+0x4a/0x50
[  383.157792]  [<ffffffff811f07d8>] ? kernfs_find_and_get_ns+0x48/0x60
[  383.157796]  [<ffffffff812f59e0>] ? cleanup_uevent_env+0x10/0x10
[  383.157800]  [<ffffffff811f3f2b>] sysfs_remove_group+0x9b/0xa0
[  383.157802]  [<ffffffff8144b59b>] dpm_sysfs_remove+0x5b/0x70
[  383.157806]  [<ffffffff8143fdc3>] device_del+0x53/0x270
[  383.157810]  [<ffffffff8147a619>] sas_rphy_remove+0x59/0x80
[  383.157814]  [<ffffffff8147ca5d>] sas_rphy_delete+0xd/0x20
[  383.157821]  [<ffffffffa0e546a1>] sas_destruct_devices+0x61/0x90 [libsas]
[  383.157824]  [<ffffffff8107114f>] process_one_work+0x14f/0x400
[  383.157828]  [<ffffffff81071766>] worker_thread+0x46/0x470
[  383.157831]  [<ffffffff81071720>] ? rescuer_thread+0x320/0x320
[  383.157835]  [<ffffffff81076662>] kthread+0xd2/0xf0
[  383.157839]  [<ffffffff81076590>] ? kthread_park+0x70/0x70
[  383.157843]  [<ffffffff817225c2>] ret_from_fork+0x22/0x30
[  383.157845] ---[ end trace 5c901a33e742b9d0 ]---
[  383.157875] drivers/scsi/mvsas/mv_sas.c 1262:found dev[2:5] is gone.
[  387.738726] drivers/scsi/mvsas/mv_sas.c 1980:phy 1 ctrl sts=0x00111000.
[  387.738743] drivers/scsi/mvsas/mv_sas.c 1982:phy 1 irq sts = 0x00000081
[  387.755992] drivers/scsi/mvsas/mv_sas.c 1980:phy 2 ctrl sts=0x00111000.
[  387.756008] drivers/scsi/mvsas/mv_sas.c 1982:phy 2 irq sts = 0x00000081
[  387.773626] drivers/scsi/mvsas/mv_sas.c 1980:phy 0 ctrl sts=0x00111000.
[  387.773642] drivers/scsi/mvsas/mv_sas.c 1982:phy 0 irq sts = 0x00000081
[  388.256644] drivers/scsi/mvsas/mv_sas.c 1980:phy 1 ctrl sts=0x00111000.
[  388.256660] drivers/scsi/mvsas/mv_sas.c 1982:phy 1 irq sts = 0x00010000
[  388.256663] drivers/scsi/mvsas/mv_sas.c 2031:notify plug in on phy[1]
[  388.276669] drivers/scsi/mvsas/mv_94xx.c 885:get all reg link rate is 0x111000
[  388.276670] drivers/scsi/mvsas/mv_94xx.c 890:get link rate is 9
[  388.396709] drivers/scsi/mvsas/mv_sas.c 1084:phy 1 attach dev info is 20001
[  388.396711] drivers/scsi/mvsas/mv_sas.c 1086:phy 1 attach sas addr is 1
[  388.396717] drivers/scsi/mvsas/mv_sas.c 277:phy 1 byte dmaded.
[  388.396730] drivers/scsi/mvsas/mv_sas.c 1980:phy 0 ctrl sts=0x00111000.
[  388.396732] drivers/scsi/mvsas/mv_sas.c 1982:phy 0 irq sts = 0x00010000
[  388.396734] drivers/scsi/mvsas/mv_sas.c 2031:notify plug in on phy[0]
[  388.396906] sas: phy-7:1 added to port-7:0, phy_mask:0x2 ( 100000000000000)
[  388.416741] drivers/scsi/mvsas/mv_94xx.c 885:get all reg link rate is 0x111000
[  388.416743] drivers/scsi/mvsas/mv_94xx.c 890:get link rate is 9
[  388.536759] drivers/scsi/mvsas/mv_sas.c 1084:phy 0 attach dev info is 20001
[  388.536761] drivers/scsi/mvsas/mv_sas.c 1086:phy 0 attach sas addr is 0
[  388.536772] drivers/scsi/mvsas/mv_sas.c 277:phy 0 byte dmaded.
[  388.536778] drivers/scsi/mvsas/mv_sas.c 1980:phy 2 ctrl sts=0x00111000.
[  388.536780] drivers/scsi/mvsas/mv_sas.c 1982:phy 2 irq sts = 0x00010000
[  388.536783] drivers/scsi/mvsas/mv_sas.c 2031:notify plug in on phy[2]
[  388.556788] drivers/scsi/mvsas/mv_94xx.c 885:get all reg link rate is 0x111000
[  388.556790] drivers/scsi/mvsas/mv_94xx.c 890:get link rate is 9
[  388.676820] drivers/scsi/mvsas/mv_sas.c 1084:phy 2 attach dev info is 20001
[  388.676822] drivers/scsi/mvsas/mv_sas.c 1086:phy 2 attach sas addr is 2
[  388.676830] drivers/scsi/mvsas/mv_sas.c 277:phy 2 byte dmaded.
[  388.676936] sas: phy-7:0 added to port-7:1, phy_mask:0x1 (               0)
[  388.677006] sas: phy-7:2 added to port-7:2, phy_mask:0x4 ( 200000000000000)
[  388.677031] sas: DOING DISCOVERY on port 0, pid:3059
[  388.677037] sas: DONE DISCOVERY on port 0, pid:3059, result:0
[  388.677050] sas: DOING DISCOVERY on port 1, pid:3059
[  388.677054] sas: DONE DISCOVERY on port 1, pid:3059, result:0
[  388.677068] sas: DOING DISCOVERY on port 2, pid:3059
[  388.677072] sas: DONE DISCOVERY on port 2, pid:3059, result:0
[  388.677182] sas: Enter sas_scsi_recover_host busy: 0 failed: 0
[  388.677284] sas: ata10: end_device-7:0: dev error handler
[  393.908358] ata10.00: qc timeout (cmd 0xec)
[  393.908364] drivers/scsi/mvsas/mv_sas.c 1545:mvs_abort_task() mvi=ffff880c2c700000 task=ffff88082dc81000 slot=ffff880c2c723578 slot_idx=x0
[  393.908370] ata10.00: failed to IDENTIFY (I/O error, err_mask=0x4)
[  393.918467] drivers/scsi/mvsas/mv_sas.c 1980:phy 1 ctrl sts=0x00111000.
[  393.918485] drivers/scsi/mvsas/mv_sas.c 1982:phy 1 irq sts = 0x00000081
[  394.436442] drivers/scsi/mvsas/mv_sas.c 1980:phy 1 ctrl sts=0x00111000.
[  394.436458] drivers/scsi/mvsas/mv_sas.c 1982:phy 1 irq sts = 0x00010000
[  394.436461] drivers/scsi/mvsas/mv_sas.c 2031:notify plug in on phy[1]
[  394.456467] drivers/scsi/mvsas/mv_94xx.c 885:get all reg link rate is 0x111000
[  394.456468] drivers/scsi/mvsas/mv_94xx.c 890:get link rate is 9
[  394.576513] drivers/scsi/mvsas/mv_sas.c 1084:phy 1 attach dev info is 20001
[  394.576514] drivers/scsi/mvsas/mv_sas.c 1086:phy 1 attach sas addr is 1
[  394.576520] drivers/scsi/mvsas/mv_sas.c 277:phy 1 byte dmaded.
[  396.148223] drivers/scsi/mvsas/mv_sas.c 1435:mvs_I_T_nexus_reset for device[0]:rc= 0
[  406.707696] ata10.00: qc timeout (cmd 0xec)
[  406.707702] drivers/scsi/mvsas/mv_sas.c 1545:mvs_abort_task() mvi=ffff880c2c700000 task=ffff88082eb44500 slot=ffff880c2c723578 slot_idx=x0
[  406.707707] ata10.00: failed to IDENTIFY (I/O error, err_mask=0x4)
[  408.947530] drivers/scsi/mvsas/mv_sas.c 1435:mvs_I_T_nexus_reset for device[0]:rc= 0
[  439.473756] ata10.00: qc timeout (cmd 0xec)
[  439.473762] drivers/scsi/mvsas/mv_sas.c 1545:mvs_abort_task() mvi=ffff880c2c700000 task=ffff88082eb44500 slot=ffff880c2c723578 slot_idx=x0
[  439.473767] ata10.00: failed to IDENTIFY (I/O error, err_mask=0x4)
[  441.713616] drivers/scsi/mvsas/mv_sas.c 1435:mvs_I_T_nexus_reset for device[0]:rc= 0
[  441.865725] sas: --- Exit sas_scsi_recover_host: busy: 0 failed: 0 tries: 1
[  441.878091] sas: Enter sas_scsi_recover_host busy: 0 failed: 0
[  441.878251] sas: ata10: end_device-7:0: dev error handler
[  441.878260] sas: ata11: end_device-7:1: dev error handler
[  447.153287] ata11.00: qc timeout (cmd 0xec)
[  447.153292] drivers/scsi/mvsas/mv_sas.c 1545:mvs_abort_task() mvi=ffff880c2c700000 task=ffff88082ecf4a00 slot=ffff880c2c723578 slot_idx=x0
[  447.153297] ata11.00: failed to IDENTIFY (I/O error, err_mask=0x4)
[  449.393185] drivers/scsi/mvsas/mv_sas.c 1435:mvs_I_T_nexus_reset for device[1]:rc= 0
[  459.952593] ata11.00: qc timeout (cmd 0xec)
[  459.952599] drivers/scsi/mvsas/mv_sas.c 1545:mvs_abort_task() mvi=ffff880c2c700000 task=ffff88082ecf4e00 slot=ffff880c2c723578 slot_idx=x0
[  459.952603] ata11.00: failed to IDENTIFY (I/O error, err_mask=0x4)
[  462.192479] drivers/scsi/mvsas/mv_sas.c 1435:mvs_I_T_nexus_reset for device[1]:rc= 0
[  492.718726] ata11.00: qc timeout (cmd 0xec)
[  492.718733] drivers/scsi/mvsas/mv_sas.c 1545:mvs_abort_task() mvi=ffff880c2c700000 task=ffff88082ecf4000 slot=ffff880c2c723578 slot_idx=x0
[  492.718740] ata11.00: failed to IDENTIFY (I/O error, err_mask=0x4)
[  494.958613] drivers/scsi/mvsas/mv_sas.c 1435:mvs_I_T_nexus_reset for device[1]:rc= 0
[  495.110598] sas: --- Exit sas_scsi_recover_host: busy: 0 failed: 0 tries: 1
[  495.111738] sas: Enter sas_scsi_recover_host busy: 0 failed: 0
[  495.111759] sas: ata10: end_device-7:0: dev error handler
[  495.111767] sas: ata11: end_device-7:1: dev error handler
[  495.111779] sas: ata12: end_device-7:2: dev error handler
[  500.398282] ata12.00: qc timeout (cmd 0xec)
[  500.398288] drivers/scsi/mvsas/mv_sas.c 1545:mvs_abort_task() mvi=ffff880c2c700000 task=ffff880c2e10d300 slot=ffff880c2c723578 slot_idx=x0
[  500.398294] ata12.00: failed to IDENTIFY (I/O error, err_mask=0x4)
[  502.638139] drivers/scsi/mvsas/mv_sas.c 1435:mvs_I_T_nexus_reset for device[2]:rc= 0
[  513.197557] ata12.00: qc timeout (cmd 0xec)
[  513.197564] drivers/scsi/mvsas/mv_sas.c 1545:mvs_abort_task() mvi=ffff880c2c700000 task=ffff880c2e10d300 slot=ffff880c2c723578 slot_idx=x0
[  513.197571] ata12.00: failed to IDENTIFY (I/O error, err_mask=0x4)
[  515.437417] drivers/scsi/mvsas/mv_sas.c 1435:mvs_I_T_nexus_reset for device[2]:rc= 0
[  545.963605] ata12.00: qc timeout (cmd 0xec)
[  545.963612] drivers/scsi/mvsas/mv_sas.c 1545:mvs_abort_task() mvi=ffff880c2c700000 task=ffff880c2ec65000 slot=ffff880c2c723578 slot_idx=x0
[  545.963619] ata12.00: failed to IDENTIFY (I/O error, err_mask=0x4)
[  548.203465] drivers/scsi/mvsas/mv_sas.c 1435:mvs_I_T_nexus_reset for device[2]:rc= 0
[  548.355561] sas: --- Exit sas_scsi_recover_host: busy: 0 failed: 0 tries: 1
[  548.366827] sas: sas_form_port: phy1 belongs to port0 already(1)!
[  795.861515] kworker/dying (6598) used greatest stack depth: 11896 bytes left
[  805.021010] kworker/dying (1153) used greatest stack depth: 11824 bytes left

^ permalink raw reply

* Re: [PATCH] ahci: Convert timers to use timer_setup()
From: Tejun Heo @ 2017-10-06 13:29 UTC (permalink / raw)
  To: Kees Cook; +Cc: LKML, linux-ide, Thomas Gleixner
In-Reply-To: <CAGXu5j+4P5BEpM03keGqsTAJoveesnouUeswNJP-DPoMyiMTWw@mail.gmail.com>

On Thu, Oct 05, 2017 at 04:37:43PM -0700, Kees Cook wrote:
> On Thu, Oct 5, 2017 at 7:21 AM, Tejun Heo <tj@kernel.org> wrote:
> > On Wed, Oct 04, 2017 at 05:54:17PM -0700, Kees Cook wrote:
> >> In preparation for unconditionally passing the struct timer_list pointer to
> >> all timer callbacks, switch to using the new timer_setup() and from_timer()
> >> to pass the timer pointer explicitly. Adds a pointer back to link
> >> structure.
> >>
> >> Cc: Tejun Heo <tj@kernel.org>
> >> Cc: linux-ide@vger.kernel.org
> >> Cc: Thomas Gleixner <tglx@linutronix.de>
> >> Signed-off-by: Kees Cook <keescook@chromium.org>
> >
> > Acked-by: Tejun Heo <tj@kernel.org>
> >
> > Please feel free to route together with other timer patches.
> 
> Most of the timer conversions are going via the maintainer trees. Are
> you able to take these? If not, I can ask tglx to take them.

Yeah, please route through timer.

Thanks.

-- 
tejun

^ permalink raw reply

* Re: [PATCH] ahci: Convert timers to use timer_setup()
From: Kees Cook @ 2017-10-05 23:37 UTC (permalink / raw)
  To: Tejun Heo; +Cc: LKML, linux-ide, Thomas Gleixner
In-Reply-To: <20171005142124.GT3301751@devbig577.frc2.facebook.com>

On Thu, Oct 5, 2017 at 7:21 AM, Tejun Heo <tj@kernel.org> wrote:
> On Wed, Oct 04, 2017 at 05:54:17PM -0700, Kees Cook wrote:
>> In preparation for unconditionally passing the struct timer_list pointer to
>> all timer callbacks, switch to using the new timer_setup() and from_timer()
>> to pass the timer pointer explicitly. Adds a pointer back to link
>> structure.
>>
>> Cc: Tejun Heo <tj@kernel.org>
>> Cc: linux-ide@vger.kernel.org
>> Cc: Thomas Gleixner <tglx@linutronix.de>
>> Signed-off-by: Kees Cook <keescook@chromium.org>
>
> Acked-by: Tejun Heo <tj@kernel.org>
>
> Please feel free to route together with other timer patches.

Most of the timer conversions are going via the maintainer trees. Are
you able to take these? If not, I can ask tglx to take them.

Thanks!

-Kees

-- 
Kees Cook
Pixel Security

^ permalink raw reply

* Re: [PATCH] ahci: Convert timers to use timer_setup()
From: Tejun Heo @ 2017-10-05 14:21 UTC (permalink / raw)
  To: Kees Cook; +Cc: linux-kernel, linux-ide, Thomas Gleixner
In-Reply-To: <20171005005417.GA23922@beast>

On Wed, Oct 04, 2017 at 05:54:17PM -0700, Kees Cook wrote:
> In preparation for unconditionally passing the struct timer_list pointer to
> all timer callbacks, switch to using the new timer_setup() and from_timer()
> to pass the timer pointer explicitly. Adds a pointer back to link
> structure.
> 
> Cc: Tejun Heo <tj@kernel.org>
> Cc: linux-ide@vger.kernel.org
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Signed-off-by: Kees Cook <keescook@chromium.org>

Acked-by: Tejun Heo <tj@kernel.org>

Please feel free to route together with other timer patches.

Thanks.

-- 
tejun

^ permalink raw reply

* Re: [PATCH] libata: Convert timers to use timer_setup()
From: Tejun Heo @ 2017-10-05 14:20 UTC (permalink / raw)
  To: Kees Cook; +Cc: linux-kernel, linux-ide, Thomas Gleixner
In-Reply-To: <20171005004842.GA23011@beast>

On Wed, Oct 04, 2017 at 05:48:42PM -0700, Kees Cook wrote:
> In preparation for unconditionally passing the struct timer_list pointer to
> all timer callbacks, switch to using the new timer_setup() and from_timer()
> to pass the timer pointer explicitly.
> 
> Cc: Tejun Heo <tj@kernel.org>
> Cc: linux-ide@vger.kernel.org
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Signed-off-by: Kees Cook <keescook@chromium.org>

Acked-by: Tejun Heo <tj@kernel.org>

Please feel free to route this with other timer changes.

Thanks.

-- 
tejun

^ permalink raw reply

* Re: [PATCH] ata: sata_rcar: Use of_device_get_match_data() helper
From: Simon Horman @ 2017-10-05  9:13 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Tejun Heo, linux-ide, linux-renesas-soc
In-Reply-To: <1507119187-12297-1-git-send-email-geert+renesas@glider.be>

On Wed, Oct 04, 2017 at 02:13:07PM +0200, Geert Uytterhoeven wrote:
> Use the of_device_get_match_data() helper instead of open coding.
> Note that the sata_rcar driver is used with DT only, so there's always a
> valid match.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Reviewed-by: Simon Horman <horms+renesas@verge.net.au>


^ permalink raw reply

* (unknown), 
From: mgriffit @ 2017-10-05  7:10 UTC (permalink / raw)
  To: linux-ide

[-- Attachment #1: INFO_22673_linux-ide.zip --]
[-- Type: application/zip, Size: 7245 bytes --]

^ permalink raw reply

* [PATCH] ahci: Convert timers to use timer_setup()
From: Kees Cook @ 2017-10-05  0:54 UTC (permalink / raw)
  To: linux-kernel; +Cc: Tejun Heo, linux-ide, Thomas Gleixner

In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly. Adds a pointer back to link
structure.

Cc: Tejun Heo <tj@kernel.org>
Cc: linux-ide@vger.kernel.org
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Kees Cook <keescook@chromium.org>
---
This requires commit 686fef928bba ("timer: Prepare to change timer
callback argument type") in v4.14-rc3, but should be otherwise
stand-alone.
---
 drivers/ata/ahci.h    |  1 +
 drivers/ata/libahci.c | 11 ++++++-----
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/ata/ahci.h b/drivers/ata/ahci.h
index 8b61123d2c3c..749fd94441b0 100644
--- a/drivers/ata/ahci.h
+++ b/drivers/ata/ahci.h
@@ -303,6 +303,7 @@ struct ahci_em_priv {
 	unsigned long saved_activity;
 	unsigned long activity;
 	unsigned long led_state;
+	struct ata_link *link;
 };
 
 struct ahci_port_priv {
diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c
index 3e286d86ab42..a0de7a38430c 100644
--- a/drivers/ata/libahci.c
+++ b/drivers/ata/libahci.c
@@ -968,12 +968,12 @@ static void ahci_sw_activity(struct ata_link *link)
 		mod_timer(&emp->timer, jiffies + msecs_to_jiffies(10));
 }
 
-static void ahci_sw_activity_blink(unsigned long arg)
+static void ahci_sw_activity_blink(struct timer_list *t)
 {
-	struct ata_link *link = (struct ata_link *)arg;
+	struct ahci_em_priv *emp = from_timer(emp, t, timer);
+	struct ata_link *link = emp->link;
 	struct ata_port *ap = link->ap;
-	struct ahci_port_priv *pp = ap->private_data;
-	struct ahci_em_priv *emp = &pp->em_priv[link->pmp];
+
 	unsigned long led_message = emp->led_state;
 	u32 activity_led_state;
 	unsigned long flags;
@@ -1020,7 +1020,8 @@ static void ahci_init_sw_activity(struct ata_link *link)
 
 	/* init activity stats, setup timer */
 	emp->saved_activity = emp->activity = 0;
-	setup_timer(&emp->timer, ahci_sw_activity_blink, (unsigned long)link);
+	emp->link = link;
+	timer_setup(&emp->timer, ahci_sw_activity_blink, 0);
 
 	/* check our blink policy and set flag for link if it's enabled */
 	if (emp->blink_policy)
-- 
2.7.4


-- 
Kees Cook
Pixel Security

^ permalink raw reply related

* [PATCH] libata: Convert timers to use timer_setup()
From: Kees Cook @ 2017-10-05  0:48 UTC (permalink / raw)
  To: linux-kernel; +Cc: Tejun Heo, linux-ide, Thomas Gleixner

In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly.

Cc: Tejun Heo <tj@kernel.org>
Cc: linux-ide@vger.kernel.org
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Kees Cook <keescook@chromium.org>
---
This requires commit 686fef928bba ("timer: Prepare to change timer
callback argument type") in v4.14-rc3, but should be otherwise
stand-alone.
---
 drivers/ata/libata-core.c | 5 ++---
 drivers/ata/libata-eh.c   | 4 ++--
 drivers/ata/libata.h      | 2 +-
 3 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 1945a8ea2099..0ac2685435a4 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -5979,9 +5979,8 @@ struct ata_port *ata_port_alloc(struct ata_host *host)
 	INIT_LIST_HEAD(&ap->eh_done_q);
 	init_waitqueue_head(&ap->eh_wait_q);
 	init_completion(&ap->park_req_pending);
-	setup_deferrable_timer(&ap->fastdrain_timer,
-			       ata_eh_fastdrain_timerfn,
-			       (unsigned long)ap);
+	timer_setup(&ap->fastdrain_timer, ata_eh_fastdrain_timerfn,
+		    TIMER_DEFERRABLE);
 
 	ap->cbl = ATA_CBL_NONE;
 
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index e4effef0c83f..ece6fd91a947 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -879,9 +879,9 @@ static int ata_eh_nr_in_flight(struct ata_port *ap)
 	return nr;
 }
 
-void ata_eh_fastdrain_timerfn(unsigned long arg)
+void ata_eh_fastdrain_timerfn(struct timer_list *t)
 {
-	struct ata_port *ap = (void *)arg;
+	struct ata_port *ap = from_timer(ap, t, fastdrain_timer);
 	unsigned long flags;
 	int cnt;
 
diff --git a/drivers/ata/libata.h b/drivers/ata/libata.h
index 839d487394b7..08a245b76417 100644
--- a/drivers/ata/libata.h
+++ b/drivers/ata/libata.h
@@ -154,7 +154,7 @@ extern void ata_internal_cmd_timed_out(struct ata_device *dev, u8 cmd);
 extern void ata_eh_acquire(struct ata_port *ap);
 extern void ata_eh_release(struct ata_port *ap);
 extern void ata_scsi_error(struct Scsi_Host *host);
-extern void ata_eh_fastdrain_timerfn(unsigned long arg);
+extern void ata_eh_fastdrain_timerfn(struct timer_list *t);
 extern void ata_qc_schedule_eh(struct ata_queued_cmd *qc);
 extern void ata_dev_disable(struct ata_device *dev);
 extern void ata_eh_detach_dev(struct ata_device *dev);
-- 
2.7.4


-- 
Kees Cook
Pixel Security

^ permalink raw reply related

* Re: [PATCH] ata: sata_rcar: Use of_device_get_match_data() helper
From: Sergei Shtylyov @ 2017-10-04 12:51 UTC (permalink / raw)
  To: Geert Uytterhoeven, Tejun Heo; +Cc: linux-ide, linux-renesas-soc
In-Reply-To: <1507119187-12297-1-git-send-email-geert+renesas@glider.be>

On 10/04/2017 03:13 PM, Geert Uytterhoeven wrote:

> Use the of_device_get_match_data() helper instead of open coding.
> Note that the sata_rcar driver is used with DT only, so there's always a
> valid match.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Acked-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

MBR, Sergei

^ permalink raw reply

* [PATCH] ata: sata_rcar: Use of_device_get_match_data() helper
From: Geert Uytterhoeven @ 2017-10-04 12:13 UTC (permalink / raw)
  To: Tejun Heo; +Cc: linux-ide, linux-renesas-soc, Geert Uytterhoeven

Use the of_device_get_match_data() helper instead of open coding.
Note that the sata_rcar driver is used with DT only, so there's always a
valid match.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 drivers/ata/sata_rcar.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/ata/sata_rcar.c b/drivers/ata/sata_rcar.c
index 537d11869069aae7..80ee2f2a50d02872 100644
--- a/drivers/ata/sata_rcar.c
+++ b/drivers/ata/sata_rcar.c
@@ -872,7 +872,6 @@ MODULE_DEVICE_TABLE(of, sata_rcar_match);
 
 static int sata_rcar_probe(struct platform_device *pdev)
 {
-	const struct of_device_id *of_id;
 	struct ata_host *host;
 	struct sata_rcar_priv *priv;
 	struct resource *mem;
@@ -888,11 +887,7 @@ static int sata_rcar_probe(struct platform_device *pdev)
 	if (!priv)
 		return -ENOMEM;
 
-	of_id = of_match_device(sata_rcar_match, &pdev->dev);
-	if (!of_id)
-		return -ENODEV;
-
-	priv->type = (enum sata_rcar_type)of_id->data;
+	priv->type = (enum sata_rcar_type)of_device_get_match_data(&pdev->dev);
 	priv->clk = devm_clk_get(&pdev->dev, NULL);
 	if (IS_ERR(priv->clk)) {
 		dev_err(&pdev->dev, "failed to get access to sata clock\n");
-- 
2.7.4

^ permalink raw reply related

* Resolved: downloads for SAS2008 based HBAs
From: Eyal Lebedinsky @ 2017-10-04  0:23 UTC (permalink / raw)
  To: list linux-ide
In-Reply-To: <e96f59a1-61a0-e88a-685c-52ddc7e49520@eyal.emu.id.au>

On 03/10/17 11:37, Eyal Lebedinsky wrote:
> First, is this the correct list? I looked at the archives and see many SATA posts.
> 
> I am about to acquire an LSI 9211-8i, and then flash it to the IT fw.
> However, I find the official sites no longer provide the necessary files.
> 
> Is there an official (or otherwise trusted) repository for these files?

Correction: Using firefox 56.0 (on f26 and w8.1) I am unable to download from the
official site
     https://docs.broadcom.com/docs/12350530
but I could download using IE11 (on w8.1) ...

> TIA

-- 
Eyal Lebedinsky (eyal@eyal.emu.id.au)

^ permalink raw reply

* Re: [PATCH v2] ide: add missing hwif->portdev freeing on hwif_init() failure
From: David Miller @ 2017-10-03 20:55 UTC (permalink / raw)
  To: helgaas
  Cc: b.zolnierkie, linux, lorenzo.pieralisi, bhelgaas, rth, ink,
	mattst88, linux-ide, linux-kernel, linux-pci
In-Reply-To: <20171003191955.GD25517@bhelgaas-glaptop.roam.corp.google.com>

From: Bjorn Helgaas <helgaas@kernel.org>
Date: Tue, 3 Oct 2017 14:19:55 -0500

> BTW, if you'd rather take these via an IDE tree, let me know and I'll
> drop it from mine.

No, feel free to take it via PCI, that's perfectly fine with me.

^ permalink raw reply

* Re: [PATCH v2] ide: add missing hwif->portdev freeing on hwif_init() failure
From: Bjorn Helgaas @ 2017-10-03 19:19 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz
  Cc: David S. Miller, Guenter Roeck, Lorenzo Pieralisi, Bjorn Helgaas,
	Richard Henderson, Ivan Kokshaysky, Matt Turner, linux-ide,
	linux-kernel, linux-pci
In-Reply-To: <20171003191108.GA25517@bhelgaas-glaptop.roam.corp.google.com>

On Tue, Oct 03, 2017 at 02:11:08PM -0500, Bjorn Helgaas wrote:
> On Tue, Oct 03, 2017 at 12:57:42PM -0500, Bjorn Helgaas wrote:
> > [+cc linux-pci for real]
> > 
> > My plan is to take these two additional fixes via the PCI tree, along
> > with Lorenzo's patch to add a pci_assign_irq() call in
> > ide_scan_pcidev(), since they're all related.
> > 
> > On Tue, Oct 03, 2017 at 01:18:47PM +0200, Bartlomiej Zolnierkiewicz wrote:
> > > Recent pci_assign_irq() changes uncovered a problem with missing
> > > freeing of ide_port class instance on hwif_init() failure in 
> > > ide_host_register():
> > > 
> > > ide0: disabled, no IRQ
> > > ide0: failed to initialize IDE interface
> > > ide0: disabling port
> > > cmd64x 0000:00:02.0: IDE controller (0x1095:0x0646 rev 0x07)
> > > CMD64x_IDE 0000:00:02.0: BAR 0: can't reserve [io  0x8050-0x8057]
> > > cmd64x 0000:00:02.0: can't reserve resources
> > > CMD64x_IDE: probe of 0000:00:02.0 failed with error -16
> > > ide_generic: please use "probe_mask=0x3f" module parameter for probing
> > > all legacy ISA IDE ports
> > > ------------[ cut here ]------------
> > > WARNING: CPU: 0 PID: 1 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x94/0xd0
> > > sysfs: cannot create duplicate filename '/class/ide_port/ide0'
> > > ...
> > > 
> > > Trace:
> > > [<fffffc00003308a0>] __warn+0x160/0x190
> > > [<fffffc000048c9f4>] sysfs_warn_dup+0x94/0xd0
> > > [<fffffc0000330928>] warn_slowpath_fmt+0x58/0x70
> > > [<fffffc000048c9f4>] sysfs_warn_dup+0x94/0xd0
> > > [<fffffc0000486d40>] kernfs_path_from_node+0x30/0x60
> > > [<fffffc00004874ac>] kernfs_put+0x16c/0x2c0
> > > [<fffffc00004874ac>] kernfs_put+0x16c/0x2c0
> > > [<fffffc000048d010>] sysfs_do_create_link_sd.isra.2+0x100/0x120
> > > [<fffffc00005b9d64>] device_add+0x2a4/0x7c0
> > > [<fffffc00005ba5cc>] device_create_groups_vargs+0x14c/0x170
> > > [<fffffc00005ba518>] device_create_groups_vargs+0x98/0x170
> > > [<fffffc00005ba690>] device_create+0x50/0x70
> > > [<fffffc00005df36c>] ide_host_register+0x48c/0xa00
> > > [<fffffc00005df330>] ide_host_register+0x450/0xa00
> > > [<fffffc00005ba2a0>] device_register+0x20/0x50
> > > [<fffffc00005df330>] ide_host_register+0x450/0xa00
> > > [<fffffc00005df944>] ide_host_add+0x64/0xe0
> > > [<fffffc000079b41c>] kobject_uevent_env+0x16c/0x710
> > > [<fffffc0000310288>] do_one_initcall+0x68/0x260
> > > [<fffffc00007b13bc>] kernel_init+0x1c/0x1a0
> > > [<fffffc00007b13a0>] kernel_init+0x0/0x1a0
> > > [<fffffc0000311868>] ret_from_kernel_thread+0x18/0x20
> > > [<fffffc00007b13a0>] kernel_init+0x0/0x1a0
> > > 
> > > ---[ end trace 24a70433c3e4d374 ]---
> > > ide0: disabling port
> > > 
> > > Fix the problem by adding missing code to ide_host_register().
> > > 
> > > Link: http://lkml.kernel.org/r/32ec730f-c1b0-5584-cd35-f8a809122b96@roeck-us.net
> > > Reported-by: Guenter Roeck <linux@roeck-us.net>
> > > Cc: Bjorn Helgaas <bhelgaas@google.com>
> > > Cc: Richard Henderson <rth@twiddle.net>
> > > Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
> > > Cc: Guenter Roeck <linux@roeck-us.net>
> > > Cc: Matt Turner <mattst88@gmail.com>
> > > Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
> 
> Applied with Guenter's tested-by to for-linus for v4.14, thanks!

BTW, if you'd rather take these via an IDE tree, let me know and I'll
drop it from mine.

> > > ---
> > > This should fix sysfs warning and probing of ide_generic driver
> > > driven ports in case of hwif_init() failure (i.e. no IRQ issue
> > > when pci_assign_irq() fix is not present).
> > > 
> > > v2:
> > > - Fixed typo in the patch description: pci_assing_irq() -> pci_assign_irq().
> > > 
> > >  drivers/ide/ide-probe.c |    1 +
> > >  1 file changed, 1 insertion(+)
> > > 
> > > Index: b/drivers/ide/ide-probe.c
> > > ===================================================================
> > > --- a/drivers/ide/ide-probe.c	2017-10-02 15:08:16.658662459 +0200
> > > +++ b/drivers/ide/ide-probe.c	2017-10-03 11:59:36.867189557 +0200
> > > @@ -1451,6 +1451,7 @@ int ide_host_register(struct ide_host *h
> > >  		if (hwif_init(hwif) == 0) {
> > >  			printk(KERN_INFO "%s: failed to initialize IDE "
> > >  					 "interface\n", hwif->name);
> > > +			device_unregister(hwif->portdev);
> > >  			device_unregister(&hwif->gendev);
> > >  			ide_disable_port(hwif);
> > >  			continue;
> > > 

^ permalink raw reply

* Re: [PATCH v2] drivers/ide/pci: Fix legacy IRQ assignment
From: Bjorn Helgaas @ 2017-10-03 19:17 UTC (permalink / raw)
  To: Lorenzo Pieralisi
  Cc: linux-pci, linux-kernel, linux-ide, Bjorn Helgaas,
	Richard Henderson, Ivan Kokshaysky, David S. Miller,
	Guenter Roeck, Matt Turner
In-Reply-To: <1506941567-10762-1-git-send-email-lorenzo.pieralisi@arm.com>

On Mon, Oct 02, 2017 at 11:52:47AM +0100, Lorenzo Pieralisi wrote:
> Through struct pci_host_bridge->{map/swizzle}_irq() hooks is now
> possible to define IRQ mapping functions on a per PCI host bridge basis.
> 
> Actual IRQ allocation is carried out by the pci_assign_irq() function in
> pci_device_probe() - to make sure a device is assigned an IRQ only if it
> is probed (ie match a driver); it retrieves a struct pci_host_bridge*
> for a given PCI device and through {map/swizzle}_irq() it carries out
> the PCI IRQ allocation.
> 
> The code conversion to struct pci_host_bridge {map/swizzle}_irq() hooks
> and pci_assign_irq() to deal with legacy IRQs in
> 
> commit 30fdfb929e82 ("PCI: Add a call to pci_assign_irq() in
> pci_device_probe()")
> 
> did not take into account that the IDE subsystem relies on a special
> purpose IDE PCI layer, configured by CONFIG_IDEPCI_PCIBUS_ORDER to force
> devices probe ordering by sidestepping the core PCI bus layer entirely
> (and therefore pci_device_probe()) by executing the registered IDE PCI
> drivers probe routines (ie registered with ide_pci_register_driver())
> through ide_scan_pcidev().
> 
> Since this IDE PCI specific probe mechanism bypasses the PCI core
> code generic probing (ie pci_device_probe()) it also misses the
> pci_assign_irq() call (among other PCI initialization functions);
> this triggers IDE PCI devices initialization failures caused
> by the missing IRQ allocation:
> 
> ide0: disabled, no IRQ
> ide0: failed to initialize IDE interface
> ide0: disabling port
> cmd64x 0000:00:02.0: IDE controller (0x1095:0x0646 rev 0x07)
> CMD64x_IDE 0000:00:02.0: BAR 0: can't reserve [io  0x8050-0x8057]
> cmd64x 0000:00:02.0: can't reserve resources
> CMD64x_IDE: probe of 0000:00:02.0 failed with error -16
> ide_generic: please use "probe_mask=0x3f" module parameter for probing
> all legacy ISA IDE ports
> ------------[ cut here ]------------
> WARNING: CPU: 0 PID: 1 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x94/0xd0
> sysfs: cannot create duplicate filename '/class/ide_port/ide0'
> ...
> 
> Trace:
> [<fffffc00003308a0>] __warn+0x160/0x190
> [<fffffc000048c9f4>] sysfs_warn_dup+0x94/0xd0
> [<fffffc0000330928>] warn_slowpath_fmt+0x58/0x70
> [<fffffc000048c9f4>] sysfs_warn_dup+0x94/0xd0
> [<fffffc0000486d40>] kernfs_path_from_node+0x30/0x60
> [<fffffc00004874ac>] kernfs_put+0x16c/0x2c0
> [<fffffc00004874ac>] kernfs_put+0x16c/0x2c0
> [<fffffc000048d010>] sysfs_do_create_link_sd.isra.2+0x100/0x120
> [<fffffc00005b9d64>] device_add+0x2a4/0x7c0
> [<fffffc00005ba5cc>] device_create_groups_vargs+0x14c/0x170
> [<fffffc00005ba518>] device_create_groups_vargs+0x98/0x170
> [<fffffc00005ba690>] device_create+0x50/0x70
> [<fffffc00005df36c>] ide_host_register+0x48c/0xa00
> [<fffffc00005df330>] ide_host_register+0x450/0xa00
> [<fffffc00005ba2a0>] device_register+0x20/0x50
> [<fffffc00005df330>] ide_host_register+0x450/0xa00
> [<fffffc00005df944>] ide_host_add+0x64/0xe0
> [<fffffc000079b41c>] kobject_uevent_env+0x16c/0x710
> [<fffffc0000310288>] do_one_initcall+0x68/0x260
> [<fffffc00007b13bc>] kernel_init+0x1c/0x1a0
> [<fffffc00007b13a0>] kernel_init+0x0/0x1a0
> [<fffffc0000311868>] ret_from_kernel_thread+0x18/0x20
> [<fffffc00007b13a0>] kernel_init+0x0/0x1a0
> 
> ---[ end trace 24a70433c3e4d374 ]---
> ide0: disabling port
> 
> Fix the IRQ allocation issue by adding a pci_assign_irq() call in the
> ide_scan_pcidev() function before probing the IDE PCI drivers, so that
> IRQs for a given PCI device are allocated for the IDE PCI drivers to
> use them for device configuration.
> 
> Fixes: 30fdfb929e82 ("PCI: Add a call to pci_assign_irq() in pci_device_probe()")
> Link: http://lkml.kernel.org/r/32ec730f-c1b0-5584-cd35-f8a809122b96@roeck-us.net
> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Reported-by: Guenter Roeck <linux@roeck-us.net>
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> Cc: Richard Henderson <rth@twiddle.net>
> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
> Cc: David S. Miller <davem@davemloft.net>
> Cc: Guenter Roeck <linux@roeck-us.net>
> Cc: Matt Turner <mattst88@gmail.com>

Applied with Guenter's tested-by, Bartlomiej's reviewed-by, and
David's ack to for-linus for v4.14, thanks!

I edited the changelog as follows (so Google can find this
discussion):

  ide: fix IRQ assignment for PCI bus order probing
  
  We used to assign IRQs for all devices at boot-time, before any drivers
  claimed devices.  The following commits:
  
    30fdfb929e82 ("PCI: Add a call to pci_assign_irq() in pci_device_probe()")
    0e4c2eeb758a ("alpha/PCI: Replace pci_fixup_irqs() call with host bridge IRQ mapping hooks")
  
  changed this so we now call pci_assign_irq() from pci_device_probe() when
  we call a driver's probe method.
  
  The ide_scan_pcibus() path (enabled by CONFIG_IDEPCI_PCIBUS_ORDER) bypasses
  pci_device_probe() so it can guarantee devices are claimed in order of PCI
  bus address.  It calls the driver's probe method directly, so it misses the
  pci_assign_irq() call (and other PCI initialization functions), which
  causes failures like this:


> ---
> v1->v2
> 
> - Moved fix from PCI core code to IDE subsystem following further
>   debugging and mailing list discussions
> - Rebased against v4.14-rc3
> 
>  drivers/ide/ide-scan-pci.c | 13 +++++++++----
>  1 file changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/ide/ide-scan-pci.c b/drivers/ide/ide-scan-pci.c
> index 86aa88a..acf8748 100644
> --- a/drivers/ide/ide-scan-pci.c
> +++ b/drivers/ide/ide-scan-pci.c
> @@ -56,6 +56,7 @@ static int __init ide_scan_pcidev(struct pci_dev *dev)
>  {
>  	struct list_head *l;
>  	struct pci_driver *d;
> +	int ret;
>  
>  	list_for_each(l, &ide_pci_drivers) {
>  		d = list_entry(l, struct pci_driver, node);
> @@ -63,10 +64,14 @@ static int __init ide_scan_pcidev(struct pci_dev *dev)
>  			const struct pci_device_id *id =
>  				pci_match_id(d->id_table, dev);
>  
> -			if (id != NULL && d->probe(dev, id) >= 0) {
> -				dev->driver = d;
> -				pci_dev_get(dev);
> -				return 1;
> +			if (id != NULL) {
> +				pci_assign_irq(dev);
> +				ret = d->probe(dev, id);
> +				if (ret >= 0) {
> +					dev->driver = d;
> +					pci_dev_get(dev);
> +					return 1;
> +				}
>  			}
>  		}
>  	}
> -- 
> 2.4.12
> 

^ permalink raw reply

* Re: [PATCH v2] ide: pci: free PCI BARs on initialization failure
From: Bjorn Helgaas @ 2017-10-03 19:13 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz
  Cc: David S. Miller, Guenter Roeck, Lorenzo Pieralisi, Bjorn Helgaas,
	Richard Henderson, Ivan Kokshaysky, Matt Turner, linux-ide,
	linux-kernel, linux-pci
In-Reply-To: <2124910.9XpgDMsQpd@amdc3058>

[+cc linux-pci]

On Tue, Oct 03, 2017 at 02:17:13PM +0200, Bartlomiej Zolnierkiewicz wrote:
> Recent pci_assign_irq() changes uncovered a problem with missing
> freeing of PCI BARs on PCI IDE host initialization failure:
> 
> ide0: disabled, no IRQ
> ide0: failed to initialize IDE interface
> ide0: disabling port
> cmd64x 0000:00:02.0: IDE controller (0x1095:0x0646 rev 0x07)
> CMD64x_IDE 0000:00:02.0: BAR 0: can't reserve [io  0x8050-0x8057]
> cmd64x 0000:00:02.0: can't reserve resources
> CMD64x_IDE: probe of 0000:00:02.0 failed with error -16
> 
> Fix the problem by adding missing freeing of PCI BARs to
> ide_setup_pci_controller() and ide_pci_init_two().
> 
> Link: http://lkml.kernel.org/r/32ec730f-c1b0-5584-cd35-f8a809122b96@roeck-us.net
> Reported-by: Guenter Roeck <linux@roeck-us.net>
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> Cc: Richard Henderson <rth@twiddle.net>
> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
> Cc: Guenter Roeck <linux@roeck-us.net>
> Cc: Matt Turner <mattst88@gmail.com>
> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>

Applied with Guenter's tested-by to for-linus for v4.14, thanks!

> ---
> This should fix problem with reserving PCI resources on a secondary
> PCI device probe attempt (please test when pci_assign_irq() fix is
> not present and "[PATCH] ide: add missing hwif->portdev freeing on
> hwif_init() failure" is applied).
> 
> v2:
> - Added missing 'goto out;' in ide_setup_pci_controller()
> 
>  drivers/ide/setup-pci.c |   63 ++++++++++++++++++++++++++++++------------------
>  1 file changed, 40 insertions(+), 23 deletions(-)
> 
> Index: b/drivers/ide/setup-pci.c
> ===================================================================
> --- a/drivers/ide/setup-pci.c	2017-10-03 14:13:02.391779813 +0200
> +++ b/drivers/ide/setup-pci.c	2017-10-03 14:13:59.051779867 +0200
> @@ -179,6 +179,7 @@ EXPORT_SYMBOL_GPL(ide_setup_pci_noise);
>  /**
>   *	ide_pci_enable	-	do PCI enables
>   *	@dev: PCI device
> + *	@bars: PCI BARs mask
>   *	@d: IDE port info
>   *
>   *	Enable the IDE PCI device. We attempt to enable the device in full
> @@ -189,9 +190,10 @@ EXPORT_SYMBOL_GPL(ide_setup_pci_noise);
>   *	Returns zero on success or an error code
>   */
>  
> -static int ide_pci_enable(struct pci_dev *dev, const struct ide_port_info *d)
> +static int ide_pci_enable(struct pci_dev *dev, int bars,
> +			  const struct ide_port_info *d)
>  {
> -	int ret, bars;
> +	int ret;
>  
>  	if (pci_enable_device(dev)) {
>  		ret = pci_enable_device_io(dev);
> @@ -216,18 +218,6 @@ static int ide_pci_enable(struct pci_dev
>  		goto out;
>  	}
>  
> -	if (d->host_flags & IDE_HFLAG_SINGLE)
> -		bars = (1 << 2) - 1;
> -	else
> -		bars = (1 << 4) - 1;
> -
> -	if ((d->host_flags & IDE_HFLAG_NO_DMA) == 0) {
> -		if (d->host_flags & IDE_HFLAG_CS5520)
> -			bars |= (1 << 2);
> -		else
> -			bars |= (1 << 4);
> -	}
> -
>  	ret = pci_request_selected_regions(dev, bars, d->name);
>  	if (ret < 0)
>  		printk(KERN_ERR "%s %s: can't reserve resources\n",
> @@ -403,6 +393,7 @@ int ide_hwif_setup_dma(ide_hwif_t *hwif,
>  /**
>   *	ide_setup_pci_controller	-	set up IDE PCI
>   *	@dev: PCI device
> + *	@bars: PCI BARs mask
>   *	@d: IDE port info
>   *	@noisy: verbose flag
>   *
> @@ -411,7 +402,7 @@ int ide_hwif_setup_dma(ide_hwif_t *hwif,
>   *	and enables it if need be
>   */
>  
> -static int ide_setup_pci_controller(struct pci_dev *dev,
> +static int ide_setup_pci_controller(struct pci_dev *dev, int bars,
>  				    const struct ide_port_info *d, int noisy)
>  {
>  	int ret;
> @@ -420,7 +411,7 @@ static int ide_setup_pci_controller(stru
>  	if (noisy)
>  		ide_setup_pci_noise(dev, d);
>  
> -	ret = ide_pci_enable(dev, d);
> +	ret = ide_pci_enable(dev, bars, d);
>  	if (ret < 0)
>  		goto out;
>  
> @@ -428,16 +419,20 @@ static int ide_setup_pci_controller(stru
>  	if (ret < 0) {
>  		printk(KERN_ERR "%s %s: error accessing PCI regs\n",
>  			d->name, pci_name(dev));
> -		goto out;
> +		goto out_free_bars;
>  	}
>  	if (!(pcicmd & PCI_COMMAND_IO)) {	/* is device disabled? */
>  		ret = ide_pci_configure(dev, d);
>  		if (ret < 0)
> -			goto out;
> +			goto out_free_bars;
>  		printk(KERN_INFO "%s %s: device enabled (Linux)\n",
>  			d->name, pci_name(dev));
>  	}
>  
> +	goto out;
> +
> +out_free_bars:
> +	pci_release_selected_regions(dev, bars);
>  out:
>  	return ret;
>  }
> @@ -540,13 +535,28 @@ int ide_pci_init_two(struct pci_dev *dev
>  {
>  	struct pci_dev *pdev[] = { dev1, dev2 };
>  	struct ide_host *host;
> -	int ret, i, n_ports = dev2 ? 4 : 2;
> +	int ret, i, n_ports = dev2 ? 4 : 2, bars;
>  	struct ide_hw hw[4], *hws[] = { NULL, NULL, NULL, NULL };
>  
> +	if (d->host_flags & IDE_HFLAG_SINGLE)
> +		bars = (1 << 2) - 1;
> +	else
> +		bars = (1 << 4) - 1;
> +
> +	if ((d->host_flags & IDE_HFLAG_NO_DMA) == 0) {
> +		if (d->host_flags & IDE_HFLAG_CS5520)
> +			bars |= (1 << 2);
> +		else
> +			bars |= (1 << 4);
> +	}
> +
>  	for (i = 0; i < n_ports / 2; i++) {
> -		ret = ide_setup_pci_controller(pdev[i], d, !i);
> -		if (ret < 0)
> +		ret = ide_setup_pci_controller(pdev[i], bars, d, !i);
> +		if (ret < 0) {
> +			if (i == 1)
> +				pci_release_selected_regions(pdev[0], bars);
>  			goto out;
> +		}
>  
>  		ide_pci_setup_ports(pdev[i], d, &hw[i*2], &hws[i*2]);
>  	}
> @@ -554,7 +564,7 @@ int ide_pci_init_two(struct pci_dev *dev
>  	host = ide_host_alloc(d, hws, n_ports);
>  	if (host == NULL) {
>  		ret = -ENOMEM;
> -		goto out;
> +		goto out_free_bars;
>  	}
>  
>  	host->dev[0] = &dev1->dev;
> @@ -576,7 +586,7 @@ int ide_pci_init_two(struct pci_dev *dev
>  		 * do_ide_setup_pci_device() on the first device!
>  		 */
>  		if (ret < 0)
> -			goto out;
> +			goto out_free_bars;
>  
>  		/* fixup IRQ */
>  		if (ide_pci_is_in_compatibility_mode(pdev[i])) {
> @@ -589,6 +599,13 @@ int ide_pci_init_two(struct pci_dev *dev
>  	ret = ide_host_register(host, d, hws);
>  	if (ret)
>  		ide_host_free(host);
> +	else
> +		goto out;
> +
> +out_free_bars:
> +	i = n_ports / 2;
> +	while (i--)
> +		pci_release_selected_regions(pdev[i], bars);
>  out:
>  	return ret;
>  }
> 

^ permalink raw reply

* Re: [PATCH v2] ide: add missing hwif->portdev freeing on hwif_init() failure
From: Bjorn Helgaas @ 2017-10-03 19:11 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz
  Cc: David S. Miller, Guenter Roeck, Lorenzo Pieralisi, Bjorn Helgaas,
	Richard Henderson, Ivan Kokshaysky, Matt Turner, linux-ide,
	linux-kernel, linux-pci
In-Reply-To: <20171003175742.GC27400@bhelgaas-glaptop.roam.corp.google.com>

On Tue, Oct 03, 2017 at 12:57:42PM -0500, Bjorn Helgaas wrote:
> [+cc linux-pci for real]
> 
> My plan is to take these two additional fixes via the PCI tree, along
> with Lorenzo's patch to add a pci_assign_irq() call in
> ide_scan_pcidev(), since they're all related.
> 
> On Tue, Oct 03, 2017 at 01:18:47PM +0200, Bartlomiej Zolnierkiewicz wrote:
> > Recent pci_assign_irq() changes uncovered a problem with missing
> > freeing of ide_port class instance on hwif_init() failure in 
> > ide_host_register():
> > 
> > ide0: disabled, no IRQ
> > ide0: failed to initialize IDE interface
> > ide0: disabling port
> > cmd64x 0000:00:02.0: IDE controller (0x1095:0x0646 rev 0x07)
> > CMD64x_IDE 0000:00:02.0: BAR 0: can't reserve [io  0x8050-0x8057]
> > cmd64x 0000:00:02.0: can't reserve resources
> > CMD64x_IDE: probe of 0000:00:02.0 failed with error -16
> > ide_generic: please use "probe_mask=0x3f" module parameter for probing
> > all legacy ISA IDE ports
> > ------------[ cut here ]------------
> > WARNING: CPU: 0 PID: 1 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x94/0xd0
> > sysfs: cannot create duplicate filename '/class/ide_port/ide0'
> > ...
> > 
> > Trace:
> > [<fffffc00003308a0>] __warn+0x160/0x190
> > [<fffffc000048c9f4>] sysfs_warn_dup+0x94/0xd0
> > [<fffffc0000330928>] warn_slowpath_fmt+0x58/0x70
> > [<fffffc000048c9f4>] sysfs_warn_dup+0x94/0xd0
> > [<fffffc0000486d40>] kernfs_path_from_node+0x30/0x60
> > [<fffffc00004874ac>] kernfs_put+0x16c/0x2c0
> > [<fffffc00004874ac>] kernfs_put+0x16c/0x2c0
> > [<fffffc000048d010>] sysfs_do_create_link_sd.isra.2+0x100/0x120
> > [<fffffc00005b9d64>] device_add+0x2a4/0x7c0
> > [<fffffc00005ba5cc>] device_create_groups_vargs+0x14c/0x170
> > [<fffffc00005ba518>] device_create_groups_vargs+0x98/0x170
> > [<fffffc00005ba690>] device_create+0x50/0x70
> > [<fffffc00005df36c>] ide_host_register+0x48c/0xa00
> > [<fffffc00005df330>] ide_host_register+0x450/0xa00
> > [<fffffc00005ba2a0>] device_register+0x20/0x50
> > [<fffffc00005df330>] ide_host_register+0x450/0xa00
> > [<fffffc00005df944>] ide_host_add+0x64/0xe0
> > [<fffffc000079b41c>] kobject_uevent_env+0x16c/0x710
> > [<fffffc0000310288>] do_one_initcall+0x68/0x260
> > [<fffffc00007b13bc>] kernel_init+0x1c/0x1a0
> > [<fffffc00007b13a0>] kernel_init+0x0/0x1a0
> > [<fffffc0000311868>] ret_from_kernel_thread+0x18/0x20
> > [<fffffc00007b13a0>] kernel_init+0x0/0x1a0
> > 
> > ---[ end trace 24a70433c3e4d374 ]---
> > ide0: disabling port
> > 
> > Fix the problem by adding missing code to ide_host_register().
> > 
> > Link: http://lkml.kernel.org/r/32ec730f-c1b0-5584-cd35-f8a809122b96@roeck-us.net
> > Reported-by: Guenter Roeck <linux@roeck-us.net>
> > Cc: Bjorn Helgaas <bhelgaas@google.com>
> > Cc: Richard Henderson <rth@twiddle.net>
> > Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
> > Cc: Guenter Roeck <linux@roeck-us.net>
> > Cc: Matt Turner <mattst88@gmail.com>
> > Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>

Applied with Guenter's tested-by to for-linus for v4.14, thanks!

> > ---
> > This should fix sysfs warning and probing of ide_generic driver
> > driven ports in case of hwif_init() failure (i.e. no IRQ issue
> > when pci_assign_irq() fix is not present).
> > 
> > v2:
> > - Fixed typo in the patch description: pci_assing_irq() -> pci_assign_irq().
> > 
> >  drivers/ide/ide-probe.c |    1 +
> >  1 file changed, 1 insertion(+)
> > 
> > Index: b/drivers/ide/ide-probe.c
> > ===================================================================
> > --- a/drivers/ide/ide-probe.c	2017-10-02 15:08:16.658662459 +0200
> > +++ b/drivers/ide/ide-probe.c	2017-10-03 11:59:36.867189557 +0200
> > @@ -1451,6 +1451,7 @@ int ide_host_register(struct ide_host *h
> >  		if (hwif_init(hwif) == 0) {
> >  			printk(KERN_INFO "%s: failed to initialize IDE "
> >  					 "interface\n", hwif->name);
> > +			device_unregister(hwif->portdev);
> >  			device_unregister(&hwif->gendev);
> >  			ide_disable_port(hwif);
> >  			continue;
> > 

^ permalink raw reply

* Re: [PATCH v2] ide: add missing hwif->portdev freeing on hwif_init() failure
From: Bjorn Helgaas @ 2017-10-03 17:57 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz
  Cc: David S. Miller, Guenter Roeck, Lorenzo Pieralisi, Bjorn Helgaas,
	Richard Henderson, Ivan Kokshaysky, Matt Turner, linux-ide,
	linux-kernel, linux-pci
In-Reply-To: <1640481.zjlggixLin@amdc3058>

[+cc linux-pci for real]

My plan is to take these two additional fixes via the PCI tree, along
with Lorenzo's patch to add a pci_assign_irq() call in
ide_scan_pcidev(), since they're all related.

On Tue, Oct 03, 2017 at 01:18:47PM +0200, Bartlomiej Zolnierkiewicz wrote:
> Recent pci_assign_irq() changes uncovered a problem with missing
> freeing of ide_port class instance on hwif_init() failure in 
> ide_host_register():
> 
> ide0: disabled, no IRQ
> ide0: failed to initialize IDE interface
> ide0: disabling port
> cmd64x 0000:00:02.0: IDE controller (0x1095:0x0646 rev 0x07)
> CMD64x_IDE 0000:00:02.0: BAR 0: can't reserve [io  0x8050-0x8057]
> cmd64x 0000:00:02.0: can't reserve resources
> CMD64x_IDE: probe of 0000:00:02.0 failed with error -16
> ide_generic: please use "probe_mask=0x3f" module parameter for probing
> all legacy ISA IDE ports
> ------------[ cut here ]------------
> WARNING: CPU: 0 PID: 1 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x94/0xd0
> sysfs: cannot create duplicate filename '/class/ide_port/ide0'
> ...
> 
> Trace:
> [<fffffc00003308a0>] __warn+0x160/0x190
> [<fffffc000048c9f4>] sysfs_warn_dup+0x94/0xd0
> [<fffffc0000330928>] warn_slowpath_fmt+0x58/0x70
> [<fffffc000048c9f4>] sysfs_warn_dup+0x94/0xd0
> [<fffffc0000486d40>] kernfs_path_from_node+0x30/0x60
> [<fffffc00004874ac>] kernfs_put+0x16c/0x2c0
> [<fffffc00004874ac>] kernfs_put+0x16c/0x2c0
> [<fffffc000048d010>] sysfs_do_create_link_sd.isra.2+0x100/0x120
> [<fffffc00005b9d64>] device_add+0x2a4/0x7c0
> [<fffffc00005ba5cc>] device_create_groups_vargs+0x14c/0x170
> [<fffffc00005ba518>] device_create_groups_vargs+0x98/0x170
> [<fffffc00005ba690>] device_create+0x50/0x70
> [<fffffc00005df36c>] ide_host_register+0x48c/0xa00
> [<fffffc00005df330>] ide_host_register+0x450/0xa00
> [<fffffc00005ba2a0>] device_register+0x20/0x50
> [<fffffc00005df330>] ide_host_register+0x450/0xa00
> [<fffffc00005df944>] ide_host_add+0x64/0xe0
> [<fffffc000079b41c>] kobject_uevent_env+0x16c/0x710
> [<fffffc0000310288>] do_one_initcall+0x68/0x260
> [<fffffc00007b13bc>] kernel_init+0x1c/0x1a0
> [<fffffc00007b13a0>] kernel_init+0x0/0x1a0
> [<fffffc0000311868>] ret_from_kernel_thread+0x18/0x20
> [<fffffc00007b13a0>] kernel_init+0x0/0x1a0
> 
> ---[ end trace 24a70433c3e4d374 ]---
> ide0: disabling port
> 
> Fix the problem by adding missing code to ide_host_register().
> 
> Link: http://lkml.kernel.org/r/32ec730f-c1b0-5584-cd35-f8a809122b96@roeck-us.net
> Reported-by: Guenter Roeck <linux@roeck-us.net>
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> Cc: Richard Henderson <rth@twiddle.net>
> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
> Cc: Guenter Roeck <linux@roeck-us.net>
> Cc: Matt Turner <mattst88@gmail.com>
> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
> ---
> This should fix sysfs warning and probing of ide_generic driver
> driven ports in case of hwif_init() failure (i.e. no IRQ issue
> when pci_assign_irq() fix is not present).
> 
> v2:
> - Fixed typo in the patch description: pci_assing_irq() -> pci_assign_irq().
> 
>  drivers/ide/ide-probe.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> Index: b/drivers/ide/ide-probe.c
> ===================================================================
> --- a/drivers/ide/ide-probe.c	2017-10-02 15:08:16.658662459 +0200
> +++ b/drivers/ide/ide-probe.c	2017-10-03 11:59:36.867189557 +0200
> @@ -1451,6 +1451,7 @@ int ide_host_register(struct ide_host *h
>  		if (hwif_init(hwif) == 0) {
>  			printk(KERN_INFO "%s: failed to initialize IDE "
>  					 "interface\n", hwif->name);
> +			device_unregister(hwif->portdev);
>  			device_unregister(&hwif->gendev);
>  			ide_disable_port(hwif);
>  			continue;
> 

^ permalink raw reply

* Re: [PATCH v2] ide: add missing hwif->portdev freeing on hwif_init() failure
From: Bjorn Helgaas @ 2017-10-03 17:53 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz
  Cc: David S. Miller, Guenter Roeck, Lorenzo Pieralisi, Bjorn Helgaas,
	Richard Henderson, Ivan Kokshaysky, Matt Turner, linux-ide,
	linux-kernel
In-Reply-To: <1640481.zjlggixLin@amdc3058>

[+cc linux-pci]

My plan is to take these two additional fixes via the PCI tree, along
with Lorenzo's patch to add a pci_assign_irq() call in
ide_scan_pcidev(), since they're all related.

On Tue, Oct 03, 2017 at 01:18:47PM +0200, Bartlomiej Zolnierkiewicz wrote:
> Recent pci_assign_irq() changes uncovered a problem with missing
> freeing of ide_port class instance on hwif_init() failure in 
> ide_host_register():
> 
> ide0: disabled, no IRQ
> ide0: failed to initialize IDE interface
> ide0: disabling port
> cmd64x 0000:00:02.0: IDE controller (0x1095:0x0646 rev 0x07)
> CMD64x_IDE 0000:00:02.0: BAR 0: can't reserve [io  0x8050-0x8057]
> cmd64x 0000:00:02.0: can't reserve resources
> CMD64x_IDE: probe of 0000:00:02.0 failed with error -16
> ide_generic: please use "probe_mask=0x3f" module parameter for probing
> all legacy ISA IDE ports
> ------------[ cut here ]------------
> WARNING: CPU: 0 PID: 1 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x94/0xd0
> sysfs: cannot create duplicate filename '/class/ide_port/ide0'
> ...
> 
> Trace:
> [<fffffc00003308a0>] __warn+0x160/0x190
> [<fffffc000048c9f4>] sysfs_warn_dup+0x94/0xd0
> [<fffffc0000330928>] warn_slowpath_fmt+0x58/0x70
> [<fffffc000048c9f4>] sysfs_warn_dup+0x94/0xd0
> [<fffffc0000486d40>] kernfs_path_from_node+0x30/0x60
> [<fffffc00004874ac>] kernfs_put+0x16c/0x2c0
> [<fffffc00004874ac>] kernfs_put+0x16c/0x2c0
> [<fffffc000048d010>] sysfs_do_create_link_sd.isra.2+0x100/0x120
> [<fffffc00005b9d64>] device_add+0x2a4/0x7c0
> [<fffffc00005ba5cc>] device_create_groups_vargs+0x14c/0x170
> [<fffffc00005ba518>] device_create_groups_vargs+0x98/0x170
> [<fffffc00005ba690>] device_create+0x50/0x70
> [<fffffc00005df36c>] ide_host_register+0x48c/0xa00
> [<fffffc00005df330>] ide_host_register+0x450/0xa00
> [<fffffc00005ba2a0>] device_register+0x20/0x50
> [<fffffc00005df330>] ide_host_register+0x450/0xa00
> [<fffffc00005df944>] ide_host_add+0x64/0xe0
> [<fffffc000079b41c>] kobject_uevent_env+0x16c/0x710
> [<fffffc0000310288>] do_one_initcall+0x68/0x260
> [<fffffc00007b13bc>] kernel_init+0x1c/0x1a0
> [<fffffc00007b13a0>] kernel_init+0x0/0x1a0
> [<fffffc0000311868>] ret_from_kernel_thread+0x18/0x20
> [<fffffc00007b13a0>] kernel_init+0x0/0x1a0
> 
> ---[ end trace 24a70433c3e4d374 ]---
> ide0: disabling port
> 
> Fix the problem by adding missing code to ide_host_register().
> 
> Link: http://lkml.kernel.org/r/32ec730f-c1b0-5584-cd35-f8a809122b96@roeck-us.net
> Reported-by: Guenter Roeck <linux@roeck-us.net>
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> Cc: Richard Henderson <rth@twiddle.net>
> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
> Cc: Guenter Roeck <linux@roeck-us.net>
> Cc: Matt Turner <mattst88@gmail.com>
> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
> ---
> This should fix sysfs warning and probing of ide_generic driver
> driven ports in case of hwif_init() failure (i.e. no IRQ issue
> when pci_assign_irq() fix is not present).
> 
> v2:
> - Fixed typo in the patch description: pci_assing_irq() -> pci_assign_irq().
> 
>  drivers/ide/ide-probe.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> Index: b/drivers/ide/ide-probe.c
> ===================================================================
> --- a/drivers/ide/ide-probe.c	2017-10-02 15:08:16.658662459 +0200
> +++ b/drivers/ide/ide-probe.c	2017-10-03 11:59:36.867189557 +0200
> @@ -1451,6 +1451,7 @@ int ide_host_register(struct ide_host *h
>  		if (hwif_init(hwif) == 0) {
>  			printk(KERN_INFO "%s: failed to initialize IDE "
>  					 "interface\n", hwif->name);
> +			device_unregister(hwif->portdev);
>  			device_unregister(&hwif->gendev);
>  			ide_disable_port(hwif);
>  			continue;
> 

^ permalink raw reply

* Re: [PATCH v2] ide: pci: free PCI BARs on initialization failure
From: Guenter Roeck @ 2017-10-03 13:43 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz, David S. Miller
  Cc: Lorenzo Pieralisi, Bjorn Helgaas, Richard Henderson,
	Ivan Kokshaysky, Matt Turner, linux-ide, linux-kernel
In-Reply-To: <2124910.9XpgDMsQpd@amdc3058>

On 10/03/2017 05:17 AM, Bartlomiej Zolnierkiewicz wrote:
> Recent pci_assign_irq() changes uncovered a problem with missing
> freeing of PCI BARs on PCI IDE host initialization failure:
> 
> ide0: disabled, no IRQ
> ide0: failed to initialize IDE interface
> ide0: disabling port
> cmd64x 0000:00:02.0: IDE controller (0x1095:0x0646 rev 0x07)
> CMD64x_IDE 0000:00:02.0: BAR 0: can't reserve [io  0x8050-0x8057]
> cmd64x 0000:00:02.0: can't reserve resources
> CMD64x_IDE: probe of 0000:00:02.0 failed with error -16
> 
> Fix the problem by adding missing freeing of PCI BARs to
> ide_setup_pci_controller() and ide_pci_init_two().
> 
> Link: http://lkml.kernel.org/r/32ec730f-c1b0-5584-cd35-f8a809122b96@roeck-us.net
> Reported-by: Guenter Roeck <linux@roeck-us.net>
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> Cc: Richard Henderson <rth@twiddle.net>
> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
> Cc: Guenter Roeck <linux@roeck-us.net>
> Cc: Matt Turner <mattst88@gmail.com>
> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>

Tested-by: Guenter Roeck <linux@roeck-us.net>

> ---
> This should fix problem with reserving PCI resources on a secondary
> PCI device probe attempt (please test when pci_assign_irq() fix is
> not present and "[PATCH] ide: add missing hwif->portdev freeing on
> hwif_init() failure" is applied).
> 
> v2:
> - Added missing 'goto out;' in ide_setup_pci_controller()
> 
>   drivers/ide/setup-pci.c |   63 ++++++++++++++++++++++++++++++------------------
>   1 file changed, 40 insertions(+), 23 deletions(-)
> 
> Index: b/drivers/ide/setup-pci.c
> ===================================================================
> --- a/drivers/ide/setup-pci.c	2017-10-03 14:13:02.391779813 +0200
> +++ b/drivers/ide/setup-pci.c	2017-10-03 14:13:59.051779867 +0200
> @@ -179,6 +179,7 @@ EXPORT_SYMBOL_GPL(ide_setup_pci_noise);
>   /**
>    *	ide_pci_enable	-	do PCI enables
>    *	@dev: PCI device
> + *	@bars: PCI BARs mask
>    *	@d: IDE port info
>    *
>    *	Enable the IDE PCI device. We attempt to enable the device in full
> @@ -189,9 +190,10 @@ EXPORT_SYMBOL_GPL(ide_setup_pci_noise);
>    *	Returns zero on success or an error code
>    */
>   
> -static int ide_pci_enable(struct pci_dev *dev, const struct ide_port_info *d)
> +static int ide_pci_enable(struct pci_dev *dev, int bars,
> +			  const struct ide_port_info *d)
>   {
> -	int ret, bars;
> +	int ret;
>   
>   	if (pci_enable_device(dev)) {
>   		ret = pci_enable_device_io(dev);
> @@ -216,18 +218,6 @@ static int ide_pci_enable(struct pci_dev
>   		goto out;
>   	}
>   
> -	if (d->host_flags & IDE_HFLAG_SINGLE)
> -		bars = (1 << 2) - 1;
> -	else
> -		bars = (1 << 4) - 1;
> -
> -	if ((d->host_flags & IDE_HFLAG_NO_DMA) == 0) {
> -		if (d->host_flags & IDE_HFLAG_CS5520)
> -			bars |= (1 << 2);
> -		else
> -			bars |= (1 << 4);
> -	}
> -
>   	ret = pci_request_selected_regions(dev, bars, d->name);
>   	if (ret < 0)
>   		printk(KERN_ERR "%s %s: can't reserve resources\n",
> @@ -403,6 +393,7 @@ int ide_hwif_setup_dma(ide_hwif_t *hwif,
>   /**
>    *	ide_setup_pci_controller	-	set up IDE PCI
>    *	@dev: PCI device
> + *	@bars: PCI BARs mask
>    *	@d: IDE port info
>    *	@noisy: verbose flag
>    *
> @@ -411,7 +402,7 @@ int ide_hwif_setup_dma(ide_hwif_t *hwif,
>    *	and enables it if need be
>    */
>   
> -static int ide_setup_pci_controller(struct pci_dev *dev,
> +static int ide_setup_pci_controller(struct pci_dev *dev, int bars,
>   				    const struct ide_port_info *d, int noisy)
>   {
>   	int ret;
> @@ -420,7 +411,7 @@ static int ide_setup_pci_controller(stru
>   	if (noisy)
>   		ide_setup_pci_noise(dev, d);
>   
> -	ret = ide_pci_enable(dev, d);
> +	ret = ide_pci_enable(dev, bars, d);
>   	if (ret < 0)
>   		goto out;
>   
> @@ -428,16 +419,20 @@ static int ide_setup_pci_controller(stru
>   	if (ret < 0) {
>   		printk(KERN_ERR "%s %s: error accessing PCI regs\n",
>   			d->name, pci_name(dev));
> -		goto out;
> +		goto out_free_bars;
>   	}
>   	if (!(pcicmd & PCI_COMMAND_IO)) {	/* is device disabled? */
>   		ret = ide_pci_configure(dev, d);
>   		if (ret < 0)
> -			goto out;
> +			goto out_free_bars;
>   		printk(KERN_INFO "%s %s: device enabled (Linux)\n",
>   			d->name, pci_name(dev));
>   	}
>   
> +	goto out;
> +
> +out_free_bars:
> +	pci_release_selected_regions(dev, bars);
>   out:
>   	return ret;
>   }
> @@ -540,13 +535,28 @@ int ide_pci_init_two(struct pci_dev *dev
>   {
>   	struct pci_dev *pdev[] = { dev1, dev2 };
>   	struct ide_host *host;
> -	int ret, i, n_ports = dev2 ? 4 : 2;
> +	int ret, i, n_ports = dev2 ? 4 : 2, bars;
>   	struct ide_hw hw[4], *hws[] = { NULL, NULL, NULL, NULL };
>   
> +	if (d->host_flags & IDE_HFLAG_SINGLE)
> +		bars = (1 << 2) - 1;
> +	else
> +		bars = (1 << 4) - 1;
> +
> +	if ((d->host_flags & IDE_HFLAG_NO_DMA) == 0) {
> +		if (d->host_flags & IDE_HFLAG_CS5520)
> +			bars |= (1 << 2);
> +		else
> +			bars |= (1 << 4);
> +	}
> +
>   	for (i = 0; i < n_ports / 2; i++) {
> -		ret = ide_setup_pci_controller(pdev[i], d, !i);
> -		if (ret < 0)
> +		ret = ide_setup_pci_controller(pdev[i], bars, d, !i);
> +		if (ret < 0) {
> +			if (i == 1)
> +				pci_release_selected_regions(pdev[0], bars);
>   			goto out;
> +		}
>   
>   		ide_pci_setup_ports(pdev[i], d, &hw[i*2], &hws[i*2]);
>   	}
> @@ -554,7 +564,7 @@ int ide_pci_init_two(struct pci_dev *dev
>   	host = ide_host_alloc(d, hws, n_ports);
>   	if (host == NULL) {
>   		ret = -ENOMEM;
> -		goto out;
> +		goto out_free_bars;
>   	}
>   
>   	host->dev[0] = &dev1->dev;
> @@ -576,7 +586,7 @@ int ide_pci_init_two(struct pci_dev *dev
>   		 * do_ide_setup_pci_device() on the first device!
>   		 */
>   		if (ret < 0)
> -			goto out;
> +			goto out_free_bars;
>   
>   		/* fixup IRQ */
>   		if (ide_pci_is_in_compatibility_mode(pdev[i])) {
> @@ -589,6 +599,13 @@ int ide_pci_init_two(struct pci_dev *dev
>   	ret = ide_host_register(host, d, hws);
>   	if (ret)
>   		ide_host_free(host);
> +	else
> +		goto out;
> +
> +out_free_bars:
> +	i = n_ports / 2;
> +	while (i--)
> +		pci_release_selected_regions(pdev[i], bars);
>   out:
>   	return ret;
>   }
> 
> 


^ permalink raw reply

* Re: [PATCH v2] ide: add missing hwif->portdev freeing on hwif_init() failure
From: Guenter Roeck @ 2017-10-03 13:43 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz, David S. Miller
  Cc: Lorenzo Pieralisi, Bjorn Helgaas, Richard Henderson,
	Ivan Kokshaysky, Matt Turner, linux-ide, linux-kernel
In-Reply-To: <1640481.zjlggixLin@amdc3058>

On 10/03/2017 04:18 AM, Bartlomiej Zolnierkiewicz wrote:
> Recent pci_assign_irq() changes uncovered a problem with missing
> freeing of ide_port class instance on hwif_init() failure in
> ide_host_register():
> 
> ide0: disabled, no IRQ
> ide0: failed to initialize IDE interface
> ide0: disabling port
> cmd64x 0000:00:02.0: IDE controller (0x1095:0x0646 rev 0x07)
> CMD64x_IDE 0000:00:02.0: BAR 0: can't reserve [io  0x8050-0x8057]
> cmd64x 0000:00:02.0: can't reserve resources
> CMD64x_IDE: probe of 0000:00:02.0 failed with error -16
> ide_generic: please use "probe_mask=0x3f" module parameter for probing
> all legacy ISA IDE ports
> ------------[ cut here ]------------
> WARNING: CPU: 0 PID: 1 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x94/0xd0
> sysfs: cannot create duplicate filename '/class/ide_port/ide0'
> ...
> 
> Trace:
> [<fffffc00003308a0>] __warn+0x160/0x190
> [<fffffc000048c9f4>] sysfs_warn_dup+0x94/0xd0
> [<fffffc0000330928>] warn_slowpath_fmt+0x58/0x70
> [<fffffc000048c9f4>] sysfs_warn_dup+0x94/0xd0
> [<fffffc0000486d40>] kernfs_path_from_node+0x30/0x60
> [<fffffc00004874ac>] kernfs_put+0x16c/0x2c0
> [<fffffc00004874ac>] kernfs_put+0x16c/0x2c0
> [<fffffc000048d010>] sysfs_do_create_link_sd.isra.2+0x100/0x120
> [<fffffc00005b9d64>] device_add+0x2a4/0x7c0
> [<fffffc00005ba5cc>] device_create_groups_vargs+0x14c/0x170
> [<fffffc00005ba518>] device_create_groups_vargs+0x98/0x170
> [<fffffc00005ba690>] device_create+0x50/0x70
> [<fffffc00005df36c>] ide_host_register+0x48c/0xa00
> [<fffffc00005df330>] ide_host_register+0x450/0xa00
> [<fffffc00005ba2a0>] device_register+0x20/0x50
> [<fffffc00005df330>] ide_host_register+0x450/0xa00
> [<fffffc00005df944>] ide_host_add+0x64/0xe0
> [<fffffc000079b41c>] kobject_uevent_env+0x16c/0x710
> [<fffffc0000310288>] do_one_initcall+0x68/0x260
> [<fffffc00007b13bc>] kernel_init+0x1c/0x1a0
> [<fffffc00007b13a0>] kernel_init+0x0/0x1a0
> [<fffffc0000311868>] ret_from_kernel_thread+0x18/0x20
> [<fffffc00007b13a0>] kernel_init+0x0/0x1a0
> 
> ---[ end trace 24a70433c3e4d374 ]---
> ide0: disabling port
> 
> Fix the problem by adding missing code to ide_host_register().
> 
> Link: http://lkml.kernel.org/r/32ec730f-c1b0-5584-cd35-f8a809122b96@roeck-us.net
> Reported-by: Guenter Roeck <linux@roeck-us.net>
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> Cc: Richard Henderson <rth@twiddle.net>
> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
> Cc: Guenter Roeck <linux@roeck-us.net>
> Cc: Matt Turner <mattst88@gmail.com>
> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>

Tested-by: Guenter Roeck <linux@roeck-us.net>

... on linux-next which actually crashes on reboot without this
and the "free up BARs on failure" patch.

Guenter

> ---
> This should fix sysfs warning and probing of ide_generic driver
> driven ports in case of hwif_init() failure (i.e. no IRQ issue
> when pci_assign_irq() fix is not present).
> 
> v2:
> - Fixed typo in the patch description: pci_assing_irq() -> pci_assign_irq().
> 
>   drivers/ide/ide-probe.c |    1 +
>   1 file changed, 1 insertion(+)
> 
> Index: b/drivers/ide/ide-probe.c
> ===================================================================
> --- a/drivers/ide/ide-probe.c	2017-10-02 15:08:16.658662459 +0200
> +++ b/drivers/ide/ide-probe.c	2017-10-03 11:59:36.867189557 +0200
> @@ -1451,6 +1451,7 @@ int ide_host_register(struct ide_host *h
>   		if (hwif_init(hwif) == 0) {
>   			printk(KERN_INFO "%s: failed to initialize IDE "
>   					 "interface\n", hwif->name);
> +			device_unregister(hwif->portdev);
>   			device_unregister(&hwif->gendev);
>   			ide_disable_port(hwif);
>   			continue;
> 
> 

^ permalink raw reply

* [GIT PULL] libata fixes for v4.14-rc3
From: Tejun Heo @ 2017-10-03 13:16 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel, linux-ide

Hello, Linus.

Nothing too interesting.  Arnd's gcc-7 warning fixes that slipped
through the cracks for two release cycles (my bad), and two minor low
level driver updates.

Thanks.

The following changes since commit c0da4fa0d1a54495d6055c009ac46b76d1da2c86:

  Merge tag 'media/v4.14-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media (2017-09-07 12:53:14 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata.git for-4.14-fixes

for you to fetch changes up to d312fefea8387503375f728855c9a62de20c9665:

  ahci: don't ignore result code of ahci_reset_controller() (2017-10-02 12:21:30 -0700)

----------------------------------------------------------------
Ard Biesheuvel (1):
      ahci: don't ignore result code of ahci_reset_controller()

Arnd Bergmann (1):
      ata: avoid gcc-7 warning in ata_timing_quantize

Ville Syrjälä (1):
      ata_piix: Add Fujitsu-Siemens Lifebook S6120 to short cable IDs

 drivers/ata/ahci.c        |  5 ++++-
 drivers/ata/ata_piix.c    |  1 +
 drivers/ata/libata-core.c | 20 ++++++++++----------
 3 files changed, 15 insertions(+), 11 deletions(-)

-- 
tejun

^ permalink raw reply

* Re: [PATCH v2] drivers/ide/pci: Fix legacy IRQ assignment
From: Bartlomiej Zolnierkiewicz @ 2017-10-03 12:20 UTC (permalink / raw)
  To: David S. Miller, Guenter Roeck
  Cc: Lorenzo Pieralisi, linux-pci, linux-kernel, linux-ide,
	Bjorn Helgaas, Richard Henderson, Ivan Kokshaysky, Matt Turner
In-Reply-To: <3245235.QGEOI6Flcd@amdc3058>

On Tuesday, October 03, 2017 02:10:11 PM Bartlomiej Zolnierkiewicz wrote:

> IDE specific problems uncovered by pci_assign_irq() change have been
> addressed in separate patches, please see:
> 
> http://patchwork.ozlabs.org/patch/820859/
> http://patchwork.ozlabs.org/patch/820870/

v2 of the 2nd patch:

http://patchwork.ozlabs.org/patch/820875/

> Guenter, could you please verify them (I have only compile tested
> them)? [ Just revert Lorenzo's fix and apply both my patches. ]

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

^ permalink raw reply

* [PATCH v2] ide: pci: free PCI BARs on initialization failure
From: Bartlomiej Zolnierkiewicz @ 2017-10-03 12:17 UTC (permalink / raw)
  To: David S. Miller
  Cc: Guenter Roeck, Lorenzo Pieralisi, Bjorn Helgaas,
	Richard Henderson, Ivan Kokshaysky, Matt Turner, linux-ide,
	linux-kernel
In-Reply-To: <CGME20171003121716epcas2p293688077d6d66b6393f029981adb6108@epcas2p2.samsung.com>

Recent pci_assign_irq() changes uncovered a problem with missing
freeing of PCI BARs on PCI IDE host initialization failure:

ide0: disabled, no IRQ
ide0: failed to initialize IDE interface
ide0: disabling port
cmd64x 0000:00:02.0: IDE controller (0x1095:0x0646 rev 0x07)
CMD64x_IDE 0000:00:02.0: BAR 0: can't reserve [io  0x8050-0x8057]
cmd64x 0000:00:02.0: can't reserve resources
CMD64x_IDE: probe of 0000:00:02.0 failed with error -16

Fix the problem by adding missing freeing of PCI BARs to
ide_setup_pci_controller() and ide_pci_init_two().

Link: http://lkml.kernel.org/r/32ec730f-c1b0-5584-cd35-f8a809122b96@roeck-us.net
Reported-by: Guenter Roeck <linux@roeck-us.net>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Matt Turner <mattst88@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
---
This should fix problem with reserving PCI resources on a secondary
PCI device probe attempt (please test when pci_assign_irq() fix is
not present and "[PATCH] ide: add missing hwif->portdev freeing on
hwif_init() failure" is applied).

v2:
- Added missing 'goto out;' in ide_setup_pci_controller()

 drivers/ide/setup-pci.c |   63 ++++++++++++++++++++++++++++++------------------
 1 file changed, 40 insertions(+), 23 deletions(-)

Index: b/drivers/ide/setup-pci.c
===================================================================
--- a/drivers/ide/setup-pci.c	2017-10-03 14:13:02.391779813 +0200
+++ b/drivers/ide/setup-pci.c	2017-10-03 14:13:59.051779867 +0200
@@ -179,6 +179,7 @@ EXPORT_SYMBOL_GPL(ide_setup_pci_noise);
 /**
  *	ide_pci_enable	-	do PCI enables
  *	@dev: PCI device
+ *	@bars: PCI BARs mask
  *	@d: IDE port info
  *
  *	Enable the IDE PCI device. We attempt to enable the device in full
@@ -189,9 +190,10 @@ EXPORT_SYMBOL_GPL(ide_setup_pci_noise);
  *	Returns zero on success or an error code
  */
 
-static int ide_pci_enable(struct pci_dev *dev, const struct ide_port_info *d)
+static int ide_pci_enable(struct pci_dev *dev, int bars,
+			  const struct ide_port_info *d)
 {
-	int ret, bars;
+	int ret;
 
 	if (pci_enable_device(dev)) {
 		ret = pci_enable_device_io(dev);
@@ -216,18 +218,6 @@ static int ide_pci_enable(struct pci_dev
 		goto out;
 	}
 
-	if (d->host_flags & IDE_HFLAG_SINGLE)
-		bars = (1 << 2) - 1;
-	else
-		bars = (1 << 4) - 1;
-
-	if ((d->host_flags & IDE_HFLAG_NO_DMA) == 0) {
-		if (d->host_flags & IDE_HFLAG_CS5520)
-			bars |= (1 << 2);
-		else
-			bars |= (1 << 4);
-	}
-
 	ret = pci_request_selected_regions(dev, bars, d->name);
 	if (ret < 0)
 		printk(KERN_ERR "%s %s: can't reserve resources\n",
@@ -403,6 +393,7 @@ int ide_hwif_setup_dma(ide_hwif_t *hwif,
 /**
  *	ide_setup_pci_controller	-	set up IDE PCI
  *	@dev: PCI device
+ *	@bars: PCI BARs mask
  *	@d: IDE port info
  *	@noisy: verbose flag
  *
@@ -411,7 +402,7 @@ int ide_hwif_setup_dma(ide_hwif_t *hwif,
  *	and enables it if need be
  */
 
-static int ide_setup_pci_controller(struct pci_dev *dev,
+static int ide_setup_pci_controller(struct pci_dev *dev, int bars,
 				    const struct ide_port_info *d, int noisy)
 {
 	int ret;
@@ -420,7 +411,7 @@ static int ide_setup_pci_controller(stru
 	if (noisy)
 		ide_setup_pci_noise(dev, d);
 
-	ret = ide_pci_enable(dev, d);
+	ret = ide_pci_enable(dev, bars, d);
 	if (ret < 0)
 		goto out;
 
@@ -428,16 +419,20 @@ static int ide_setup_pci_controller(stru
 	if (ret < 0) {
 		printk(KERN_ERR "%s %s: error accessing PCI regs\n",
 			d->name, pci_name(dev));
-		goto out;
+		goto out_free_bars;
 	}
 	if (!(pcicmd & PCI_COMMAND_IO)) {	/* is device disabled? */
 		ret = ide_pci_configure(dev, d);
 		if (ret < 0)
-			goto out;
+			goto out_free_bars;
 		printk(KERN_INFO "%s %s: device enabled (Linux)\n",
 			d->name, pci_name(dev));
 	}
 
+	goto out;
+
+out_free_bars:
+	pci_release_selected_regions(dev, bars);
 out:
 	return ret;
 }
@@ -540,13 +535,28 @@ int ide_pci_init_two(struct pci_dev *dev
 {
 	struct pci_dev *pdev[] = { dev1, dev2 };
 	struct ide_host *host;
-	int ret, i, n_ports = dev2 ? 4 : 2;
+	int ret, i, n_ports = dev2 ? 4 : 2, bars;
 	struct ide_hw hw[4], *hws[] = { NULL, NULL, NULL, NULL };
 
+	if (d->host_flags & IDE_HFLAG_SINGLE)
+		bars = (1 << 2) - 1;
+	else
+		bars = (1 << 4) - 1;
+
+	if ((d->host_flags & IDE_HFLAG_NO_DMA) == 0) {
+		if (d->host_flags & IDE_HFLAG_CS5520)
+			bars |= (1 << 2);
+		else
+			bars |= (1 << 4);
+	}
+
 	for (i = 0; i < n_ports / 2; i++) {
-		ret = ide_setup_pci_controller(pdev[i], d, !i);
-		if (ret < 0)
+		ret = ide_setup_pci_controller(pdev[i], bars, d, !i);
+		if (ret < 0) {
+			if (i == 1)
+				pci_release_selected_regions(pdev[0], bars);
 			goto out;
+		}
 
 		ide_pci_setup_ports(pdev[i], d, &hw[i*2], &hws[i*2]);
 	}
@@ -554,7 +564,7 @@ int ide_pci_init_two(struct pci_dev *dev
 	host = ide_host_alloc(d, hws, n_ports);
 	if (host == NULL) {
 		ret = -ENOMEM;
-		goto out;
+		goto out_free_bars;
 	}
 
 	host->dev[0] = &dev1->dev;
@@ -576,7 +586,7 @@ int ide_pci_init_two(struct pci_dev *dev
 		 * do_ide_setup_pci_device() on the first device!
 		 */
 		if (ret < 0)
-			goto out;
+			goto out_free_bars;
 
 		/* fixup IRQ */
 		if (ide_pci_is_in_compatibility_mode(pdev[i])) {
@@ -589,6 +599,13 @@ int ide_pci_init_two(struct pci_dev *dev
 	ret = ide_host_register(host, d, hws);
 	if (ret)
 		ide_host_free(host);
+	else
+		goto out;
+
+out_free_bars:
+	i = n_ports / 2;
+	while (i--)
+		pci_release_selected_regions(pdev[i], bars);
 out:
 	return ret;
 }


^ permalink raw reply

* Re: [PATCH v2] drivers/ide/pci: Fix legacy IRQ assignment
From: Bartlomiej Zolnierkiewicz @ 2017-10-03 12:10 UTC (permalink / raw)
  To: David S. Miller, Guenter Roeck
  Cc: Lorenzo Pieralisi, linux-pci, linux-kernel, linux-ide,
	Bjorn Helgaas, Richard Henderson, Ivan Kokshaysky, Matt Turner
In-Reply-To: <4605844.iOhxHctWQT@amdc3058>


On Tuesday, October 03, 2017 11:39:55 AM Bartlomiej Zolnierkiewicz wrote:
> On Monday, October 02, 2017 11:52:47 AM Lorenzo Pieralisi wrote:
> > Through struct pci_host_bridge->{map/swizzle}_irq() hooks is now
> > possible to define IRQ mapping functions on a per PCI host bridge basis.
> > 
> > Actual IRQ allocation is carried out by the pci_assign_irq() function in
> > pci_device_probe() - to make sure a device is assigned an IRQ only if it
> > is probed (ie match a driver); it retrieves a struct pci_host_bridge*
> > for a given PCI device and through {map/swizzle}_irq() it carries out
> > the PCI IRQ allocation.
> > 
> > The code conversion to struct pci_host_bridge {map/swizzle}_irq() hooks
> > and pci_assign_irq() to deal with legacy IRQs in
> > 
> > commit 30fdfb929e82 ("PCI: Add a call to pci_assign_irq() in
> > pci_device_probe()")
> > 
> > did not take into account that the IDE subsystem relies on a special
> > purpose IDE PCI layer, configured by CONFIG_IDEPCI_PCIBUS_ORDER to force
> > devices probe ordering by sidestepping the core PCI bus layer entirely
> > (and therefore pci_device_probe()) by executing the registered IDE PCI
> > drivers probe routines (ie registered with ide_pci_register_driver())
> > through ide_scan_pcidev().
> > 
> > Since this IDE PCI specific probe mechanism bypasses the PCI core
> > code generic probing (ie pci_device_probe()) it also misses the
> > pci_assign_irq() call (among other PCI initialization functions);
> > this triggers IDE PCI devices initialization failures caused
> > by the missing IRQ allocation:
> > 
> > ide0: disabled, no IRQ
> > ide0: failed to initialize IDE interface
> > ide0: disabling port
> > cmd64x 0000:00:02.0: IDE controller (0x1095:0x0646 rev 0x07)
> > CMD64x_IDE 0000:00:02.0: BAR 0: can't reserve [io  0x8050-0x8057]
> > cmd64x 0000:00:02.0: can't reserve resources
> > CMD64x_IDE: probe of 0000:00:02.0 failed with error -16
> > ide_generic: please use "probe_mask=0x3f" module parameter for probing
> > all legacy ISA IDE ports
> > ------------[ cut here ]------------
> > WARNING: CPU: 0 PID: 1 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x94/0xd0
> > sysfs: cannot create duplicate filename '/class/ide_port/ide0'
> > ...
> > 
> > Trace:
> > [<fffffc00003308a0>] __warn+0x160/0x190
> > [<fffffc000048c9f4>] sysfs_warn_dup+0x94/0xd0
> > [<fffffc0000330928>] warn_slowpath_fmt+0x58/0x70
> > [<fffffc000048c9f4>] sysfs_warn_dup+0x94/0xd0
> > [<fffffc0000486d40>] kernfs_path_from_node+0x30/0x60
> > [<fffffc00004874ac>] kernfs_put+0x16c/0x2c0
> > [<fffffc00004874ac>] kernfs_put+0x16c/0x2c0
> > [<fffffc000048d010>] sysfs_do_create_link_sd.isra.2+0x100/0x120
> > [<fffffc00005b9d64>] device_add+0x2a4/0x7c0
> > [<fffffc00005ba5cc>] device_create_groups_vargs+0x14c/0x170
> > [<fffffc00005ba518>] device_create_groups_vargs+0x98/0x170
> > [<fffffc00005ba690>] device_create+0x50/0x70
> > [<fffffc00005df36c>] ide_host_register+0x48c/0xa00
> > [<fffffc00005df330>] ide_host_register+0x450/0xa00
> > [<fffffc00005ba2a0>] device_register+0x20/0x50
> > [<fffffc00005df330>] ide_host_register+0x450/0xa00
> > [<fffffc00005df944>] ide_host_add+0x64/0xe0
> > [<fffffc000079b41c>] kobject_uevent_env+0x16c/0x710
> > [<fffffc0000310288>] do_one_initcall+0x68/0x260
> > [<fffffc00007b13bc>] kernel_init+0x1c/0x1a0
> > [<fffffc00007b13a0>] kernel_init+0x0/0x1a0
> > [<fffffc0000311868>] ret_from_kernel_thread+0x18/0x20
> > [<fffffc00007b13a0>] kernel_init+0x0/0x1a0
> > 
> > ---[ end trace 24a70433c3e4d374 ]---
> > ide0: disabling port
> > 
> > Fix the IRQ allocation issue by adding a pci_assign_irq() call in the
> > ide_scan_pcidev() function before probing the IDE PCI drivers, so that
> > IRQs for a given PCI device are allocated for the IDE PCI drivers to
> > use them for device configuration.
> > 
> > Fixes: 30fdfb929e82 ("PCI: Add a call to pci_assign_irq() in pci_device_probe()")
> > Link: http://lkml.kernel.org/r/32ec730f-c1b0-5584-cd35-f8a809122b96@roeck-us.net
> > Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> > Reported-by: Guenter Roeck <linux@roeck-us.net>
> > Cc: Bjorn Helgaas <bhelgaas@google.com>
> > Cc: Richard Henderson <rth@twiddle.net>
> > Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
> > Cc: David S. Miller <davem@davemloft.net>
> > Cc: Guenter Roeck <linux@roeck-us.net>
> > Cc: Matt Turner <mattst88@gmail.com>
> 
> Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>

IDE specific problems uncovered by pci_assign_irq() change have been
addressed in separate patches, please see:

http://patchwork.ozlabs.org/patch/820859/
http://patchwork.ozlabs.org/patch/820870/

Guenter, could you please verify them (I have only compile tested
them)? [ Just revert Lorenzo's fix and apply both my patches. ]

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox