From: alexander.levin@verizon.com
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"stable@vger.kernel.org" <stable@vger.kernel.org>
Cc: Martin Wilck <mwilck@suse.de>,
Don Brace <don.brace@microsemi.com>,
"Martin K . Petersen" <martin.petersen@oracle.com>,
alexander.levin@verizon.com
Subject: [PATCH AUTOSEL for 4.4 085/101] scsi: hpsa: destroy sas transport properties before scsi_host
Date: Thu, 7 Dec 2017 15:50:32 +0000 [thread overview]
Message-ID: <20171207155005.5852-85-alexander.levin@verizon.com> (raw)
In-Reply-To: <20171207155005.5852-1-alexander.levin@verizon.com>
From: Martin Wilck <mwilck@suse.de>
[ Upstream commit dfb2e6f46b3074eb85203d8f0888b71ec1c2e37a ]
This patch cleans up a lot of warnings when unloading the driver.
A current example of the stack trace starts with:
[ 142.570715] sysfs group 'power' not found for kobject 'port-5:0'
There can be hundreds of these messages during a driver unload.
I am resubmitting this patch on behalf of Martin Wilck with his
permission.
His original patch can be found here:
https://www.spinics.net/lists/linux-scsi/msg102085.html
This patch did not help until Hannes's
commit 9441284fbc39 ("scsi-fixup-kernel-warning-during-rmmod")
was applied to the kernel.
---------------------------
Original patch description:
---------------------------
Unloading the hpsa driver causes warnings
[ 1063.793652] WARNING: CPU: 1 PID: 4850 at ../fs/sysfs/group.c:237 device_del+0x54/0x240()
[ 1063.793659] sysfs group ffffffff81cf21a0 not found for kobject 'port-2:0'
with two different stacks:
1)
[ 1063.793774] [<ffffffff81448af4>] device_del+0x54/0x240
[ 1063.793780] [<ffffffff8145178a>] transport_remove_classdev+0x4a/0x60
[ 1063.793784] [<ffffffff81451216>] attribute_container_device_trigger+0xa6/0xb0
[ 1063.793802] [<ffffffffa0105d46>] sas_port_delete+0x126/0x160 [scsi_transport_sas]
[ 1063.793819] [<ffffffffa036ebcc>] hpsa_free_sas_port+0x3c/0x70 [hpsa]
2)
[ 1063.797103] [<ffffffff81448af4>] device_del+0x54/0x240
[ 1063.797118] [<ffffffffa0105d4e>] sas_port_delete+0x12e/0x160 [scsi_transport_sas]
[ 1063.797134] [<ffffffffa036ebcc>] hpsa_free_sas_port+0x3c/0x70 [hpsa]
This is caused by the fact that host device hostX is deleted before the
SAS transport devices hostX/port-a:b.
This patch fixes this by reverting the order of device deletions.
Tested-by: Don Brace <don.brace@microsemi.com>
Reviewed-by: Don Brace <don.brace@microsemi.com>
Signed-off-by: Martin Wilck <mwilck@suse.de>
Signed-off-by: Don Brace <don.brace@microsemi.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
drivers/scsi/hpsa.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index b37e85126f63..0c87f341fed4 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -8808,6 +8808,8 @@ static void hpsa_remove_one(struct pci_dev *pdev)
destroy_workqueue(h->rescan_ctlr_wq);
destroy_workqueue(h->resubmit_wq);
+ hpsa_delete_sas_host(h);
+
/*
* Call before disabling interrupts.
* scsi_remove_host can trigger I/O operations especially
@@ -8842,8 +8844,6 @@ static void hpsa_remove_one(struct pci_dev *pdev)
h->lockup_detected = NULL; /* init_one 2 */
/* (void) pci_disable_pcie_error_reporting(pdev); */ /* init_one 1 */
- hpsa_delete_sas_host(h);
-
kfree(h); /* init_one 1 */
}
--
2.11.0
next prev parent reply other threads:[~2017-12-07 16:32 UTC|newest]
Thread overview: 100+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-07 15:50 [PATCH AUTOSEL for 4.4 001/101] usb: phy: isp1301: Add OF device ID table alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 005/101] net: initialize msg.msg_flags in recvfrom alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 004/101] userfaultfd: selftest: vm: allow to build in vm/ directory alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 002/101] md-cluster: free md_cluster_info if node leave cluster alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 003/101] userfaultfd: shmem: __do_fault requires VM_FAULT_NOPAGE alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 006/101] net: bcmgenet: correct the RBUF_OVFL_CNT and RBUF_ERR_CNT MIB values alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 007/101] net: bcmgenet: correct MIB access of UniMAC RUNT counters alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 008/101] net: bcmgenet: reserved phy revisions must be checked first alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 010/101] net: bcmgenet: Power up the internal PHY before probing the MII alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 012/101] NFSD: fix nfsd_reset_versions for NFSv4 alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 011/101] NFSD: fix nfsd_minorversion(.., NFSD_AVAIL) alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 009/101] net: bcmgenet: power down internal phy if open or resume fails alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 015/101] netfilter: bridge: honor frag_max_size when refragmenting alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 013/101] Input: i8042 - add TUXEDO BU1406 (N24_25BU) to the nomux list alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 014/101] drm/omap: fix dmabuf mmap for dma_alloc'ed buffers alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 016/101] writeback: fix memory leak in wb_queue_work() alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 017/101] net: wimax/i2400m: fix NULL-deref at probe alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 019/101] net: Resend IGMP memberships upon peer notification alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 018/101] dmaengine: Fix array index out of bounds warning in __get_unmap_pool() alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 020/101] mlxsw: reg: Fix SPVM max record count alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 021/101] mlxsw: reg: Fix SPVMLR " alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 023/101] openrisc: fix issue handling 8 byte get_user calls alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 024/101] scsi: hpsa: update check for logical volume status alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 022/101] intel_th: pci: Add Gemini Lake support alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 025/101] scsi: hpsa: limit outstanding rescans alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 027/101] drm/radeon/si: add dpm quirk for Oland alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 028/101] sched/deadline: Make sure the replenishment timer fires in the next period alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 029/101] sched/deadline: Throttle a constrained deadline task activated after the deadline alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 026/101] fjes: Fix wrong netdevice feature flags alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 033/101] afs: Fix missing put_page() alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 030/101] sched/deadline: Use deadline instead of period when calculating overflow alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 031/101] mmc: mediatek: Fixed bug where clock frequency could be set wrong alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 032/101] drm/radeon: reinstate oland workaround for sclk alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 036/101] afs: Flush outstanding writes when an fd is closed alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 034/101] afs: Populate group ID from vnode status alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 035/101] afs: Adjust mode bits processing alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 037/101] afs: Migrate vlocation fields to 64-bit alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 038/101] afs: Prevent callback expiry timer overflow alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 040/101] afs: Populate and use client modification time alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 039/101] afs: Fix the maths in afs_fs_store_data() alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 041/101] afs: Fix page leak in afs_write_begin() alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 045/101] efi/esrt: Cleanup bad memory map log messages alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 043/101] net/mlx4_core: Avoid delays during VF driver device shutdown alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 044/101] perf symbols: Fix symbols__fixup_end heuristic for corner cases alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 042/101] afs: Fix afs_kill_pages() alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 048/101] target: Use system workqueue for ALUA transitions alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 047/101] btrfs: add missing memset while reading compressed inline extents alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 049/101] target: fix ALUA transition timeout handling alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 046/101] NFSv4.1 respect server's max size in CREATE_SESSION alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 050/101] target: fix race during implicit transition work flushes alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 051/101] sfc: don't warn on successful change of MAC alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 053/101] video: udlfb: Fix read EDID timeout alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 052/101] fbdev: controlfb: Add missing modes to fix out of bounds access alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 054/101] video: fbdev: au1200fb: Release some resources if a memory allocation fails alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 056/101] rtc: pcf8563: fix output clock rate alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 055/101] video: fbdev: au1200fb: Return an error code if a memory allocation fails alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 057/101] ASoC: cs42l56: Fix reset GPIO name in example DT binding alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 060/101] powerpc/powernv/cpufreq: Fix the frequency read by /proc/cpuinfo alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 061/101] netfilter: ipvs: Fix inappropriate output of procfs alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 059/101] PCI/PME: Handle invalid data when reading Root Status alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 058/101] dmaengine: ti-dma-crossbar: Correct am335x/am43xx mux value type alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 064/101] platform/x86: sony-laptop: Fix error handling in sony_nc_setup_rfkill() alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 062/101] powerpc/opal: Fix EBUSY bug in acquiring tokens alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 065/101] target/iscsi: Fix a race condition in iscsit_add_reject_from_cmd() alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 063/101] powerpc/ipic: Fix status get and status clear alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 069/101] arm-ccn: perf: Prevent module unload while PMU is in use alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 068/101] target/file: Do not return error for UNMAP if length is zero alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 066/101] iscsi-target: fix memory leak in lio_target_tiqn_addtpg() alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 067/101] target:fix condition return in core_pr_dump_initiator_port() alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 073/101] clk: imx6: refine hdmi_isfr's parent to make HDMI work on i.MX6 SoCs w/o VPU alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 070/101] crypto: tcrypt - fix buffer lengths in test_aead_speed() alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 071/101] mm: Handle 0 flags in _calc_vm_trans() macro alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 072/101] clk: mediatek: add the option for determining PLL source clock alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 077/101] GFS2: Take inode off order_write list when setting jdata flag alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 075/101] ppp: Destroy the mutex when cleanup alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 076/101] thermal/drivers/step_wise: Fix temperature regulation misbehavior alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 074/101] clk: tegra: Fix cclk_lp divisor register alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 078/101] bcache: explicitly destroy mutex while exiting alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 080/101] l2tp: cleanup l2tp_tunnel_delete calls alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 081/101] xfs: fix log block underflow during recovery cycle verification alexander.levin
2017-12-07 15:50 ` alexander.levin [this message]
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 084/101] scsi: hpsa: cleanup sas_phy structures in sysfs when unloading alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 083/101] PCI: Detach driver before procfs & sysfs teardown on device remove alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 082/101] xfs: fix incorrect extent state in xfs_bmap_add_extent_unwritten_real alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 088/101] dmaengine: rcar-dmac: use TCRB instead of TCR for residue alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 089/101] pinctrl: adi2: Fix Kconfig build problem alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 087/101] tty fix oops when rmmod 8250 alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 086/101] powerpc/perf/hv-24x7: Fix incorrect comparison in memord alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 090/101] raid5: Set R5_Expanded on parity devices as well as data alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 091/101] scsi: scsi_devinfo: Add REPORTLUN2 to EMC SYMMETRIX blacklist entry alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 093/101] ASoC: samsung: i2s: disable secondary DAI until it gets fixed alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 092/101] vt6655: Fix a possible sleep-in-atomic bug in vt6655_suspend alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 095/101] scsi: sd: change allow_restart to bool in sysfs interface alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 094/101] scsi: sd: change manage_start_stop " alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 097/101] udf: Avoid overflow when session starts at large offset alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 096/101] scsi: bfa: integer overflow in debugfs alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 100/101] IB/ipoib: Grab rtnl lock on heavy flush when calling ndo_open/stop alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 099/101] RDMA/cma: Avoid triggering undefined behavior alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 101/101] ath9k: fix tx99 potential info leak alexander.levin
2017-12-07 15:50 ` [PATCH AUTOSEL for 4.4 098/101] macvlan: Only deliver one copy of the frame to the macvlan interface alexander.levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171207155005.5852-85-alexander.levin@verizon.com \
--to=alexander.levin@verizon.com \
--cc=don.brace@microsemi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=mwilck@suse.de \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®