Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756293AbbHYVGS (ORCPT ); Tue, 25 Aug 2015 17:06:18 -0400 Received: from mail.linux-iscsi.org ([67.23.28.174]:54158 "EHLO linux-iscsi.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751798AbbHYVGR (ORCPT ); Tue, 25 Aug 2015 17:06:17 -0400 Message-ID: <1440536775.23178.2.camel@haakon3.risingtidesystems.com> Subject: Re: [PATCH v4 2/2] mpt2sas: Refcount fw_events and fix unsafe list usage From: "Nicholas A. Bellinger" To: Calvin Owens Cc: Nagalakshmi Nandigama , Praveen Krishnamoorthy , Sreekanth Reddy , Abhijit Mahajan , MPT-FusionLinux.pdl@avagotech.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@fb.com, Joe Lawrence , Christoph Hellwig Date: Tue, 25 Aug 2015 14:06:15 -0700 In-Reply-To: <5710d5e272a19c252db0171133a1092be00208f2.1439510240.git.calvinowens@fb.com> References: <5710d5e272a19c252db0171133a1092be00208f2.1439510240.git.calvinowens@fb.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.4.4-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1537 Lines: 39 On Thu, 2015-08-13 at 18:48 -0700, Calvin Owens wrote: > The fw_event_work struct is concurrently referenced at shutdown, so > add a refcount to protect it, and refactor the code to use it. > > Additionally, refactor _scsih_fw_event_cleanup_queue() such that it > no longer iterates over the list without holding the lock, since > _firmware_event_work() concurrently deletes items from the list. > > Cc: Christoph Hellwig > Signed-off-by: Calvin Owens > --- > Changes in v4: None > > Changes in v3: > * Add a break condition to the REMOVE_UNRESPONDING_DEVICES fw_event, > which can loop over a sleep forever (5m+ at least) at unloading. I > don't think anything prevented this before, but taking the fw_event > object off the list at the top of _firmware_event_work() seems to have > made it more likely to happen. > > Changes in v2: > * Squished patches 4-6 into one patch > * Remove the fw_event from fw_event_list at the start of > _firmware_event_work() > * Explicitly seperate fw_event_list removal from fw_event freeing > > drivers/scsi/mpt2sas/mpt2sas_scsih.c | 112 ++++++++++++++++++++++++++++------- > 1 file changed, 91 insertions(+), 21 deletions(-) > Looks good. Reviewed-by: Nicholas Bellinger -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/