From patchwork Mon Jul 10 22:47:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauricio Faria de Oliveira X-Patchwork-Id: 9833841 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C600560363 for ; Mon, 10 Jul 2017 22:48:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B7C40283CF for ; Mon, 10 Jul 2017 22:48:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AB1BF28505; Mon, 10 Jul 2017 22:48:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4AE0C283CF for ; Mon, 10 Jul 2017 22:48:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755033AbdGJWsH (ORCPT ); Mon, 10 Jul 2017 18:48:07 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:58658 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755035AbdGJWsG (ORCPT ); Mon, 10 Jul 2017 18:48:06 -0400 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v6AMasdt145016 for ; Mon, 10 Jul 2017 18:48:00 -0400 Received: from e24smtp05.br.ibm.com (e24smtp05.br.ibm.com [32.104.18.26]) by mx0a-001b2d01.pphosted.com with ESMTP id 2bmbr5xq1s-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 10 Jul 2017 18:48:00 -0400 Received: from localhost by e24smtp05.br.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 10 Jul 2017 19:47:58 -0300 Received: from d24relay02.br.ibm.com (9.13.39.42) by e24smtp05.br.ibm.com (10.172.0.141) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 10 Jul 2017 19:47:56 -0300 Received: from d24av04.br.ibm.com (d24av04.br.ibm.com [9.8.31.97]) by d24relay02.br.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v6AMlt5Y8782150; Mon, 10 Jul 2017 19:47:55 -0300 Received: from d24av04.br.ibm.com (localhost [127.0.0.1]) by d24av04.br.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v6AMluS1009548; Mon, 10 Jul 2017 19:47:56 -0300 Received: from t440.ibm.com ([9.85.207.174]) by d24av04.br.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v6AMldAM009404; Mon, 10 Jul 2017 19:47:53 -0300 From: Mauricio Faria de Oliveira To: jejb@linux.vnet.ibm.com, martin.petersen@oracle.com Cc: hare@suse.de, bart.vanassche@sandisk.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 4/4] scsi: scsi_dh_alua: add sdev_dbg() to track alua_rtpg_work() Date: Mon, 10 Jul 2017 19:47:37 -0300 X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499726857-7875-1-git-send-email-mauricfo@linux.vnet.ibm.com> References: <1499726857-7875-1-git-send-email-mauricfo@linux.vnet.ibm.com> X-TM-AS-MML: disable x-cbid: 17071022-0032-0000-0000-00000573DC83 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17071022-0033-0000-0000-000011FA0B5C Message-Id: <1499726857-7875-5-git-send-email-mauricfo@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-07-10_08:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1707100389 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Insert sdev_dbg() calls in the function path which may queue alua_rtpg_work() past initialization, for debugging purposes: - alua_activate() - alua_check_sense() - alua_rtpg_queue() Signed-off-by: Mauricio Faria de Oliveira --- drivers/scsi/device_handler/scsi_dh_alua.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c b/drivers/scsi/device_handler/scsi_dh_alua.c index e0bf0827a980..5bf0d55f6eb1 100644 --- a/drivers/scsi/device_handler/scsi_dh_alua.c +++ b/drivers/scsi/device_handler/scsi_dh_alua.c @@ -422,6 +422,10 @@ static char print_alua_state(unsigned char state) static int alua_check_sense(struct scsi_device *sdev, struct scsi_sense_hdr *sense_hdr) { + sdev_dbg(sdev, "%s: %s(): Sense Key: 0x%x, ASC: 0x%x, ASCQ: 0x%x\n", + ALUA_DH_NAME, __func__, sense_hdr->sense_key, + sense_hdr->asc, sense_hdr->ascq); + switch (sense_hdr->sense_key) { case NOT_READY: if (sense_hdr->asc == 0x04 && sense_hdr->ascq == 0x0a) { @@ -987,10 +991,13 @@ static bool alua_rtpg_queue(struct alua_port_group *pg, spin_unlock_irqrestore(&pg->lock, flags); if (start_queue) { + if (queue_delayed_work(alua_wq, &pg->rtpg_work, - msecs_to_jiffies(ALUA_RTPG_DELAY_MSECS))) + msecs_to_jiffies(ALUA_RTPG_DELAY_MSECS))) { + sdev_dbg(sdev, "%s: %s(): port group %02x\n", + ALUA_DH_NAME, __func__, pg->group_id); sdev = NULL; - else + } else kref_put(&pg->kref, release_port_group); } if (sdev) @@ -1100,6 +1107,9 @@ static int alua_activate(struct scsi_device *sdev, rcu_read_unlock(); mutex_unlock(&h->init_mutex); + sdev_dbg(sdev, "%s: %s(): port group %02x, fn: %pf()\n", + ALUA_DH_NAME, __func__, pg->group_id, fn); + if (alua_rtpg_queue(pg, sdev, qdata, true)) fn = NULL; else