Received: by 10.223.185.116 with SMTP id b49csp8121429wrg; Thu, 1 Mar 2018 17:59:32 -0800 (PST) X-Google-Smtp-Source: AG47ELstow/pAn/C1E1g+4fmV46ay2hnnn3AG/N6GpqxvckY9/X/ci3Io4Rvld5rWAPtOPS5AuAd X-Received: by 10.99.52.203 with SMTP id b194mr3282012pga.349.1519955972838; Thu, 01 Mar 2018 17:59:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519955972; cv=none; d=google.com; s=arc-20160816; b=ZuKI9NbYHT5GdVQgMuFazQ8HyOalButELuG0gjxPIpxR2CLzUoHeN3li12USujtUX1 KxK/rvOrBxypLrByKgt9seBxm0uoW/LNdvsMHSaS1APhx0EdTG/wzUPjhJhwncQ1WJ4R 5aH9zZ8Li+Ho47gBVmHTNaqVS56eLlz0oFhiBMgamZAJysm3jqoohKFkyA3julOD6lbz eugiI2Fc+Ii6ubUVbDN8SGPQPtWNRaUfXYixWiFZoZ0DeWZ03quCDIkU9iEuKy9JrDF2 zXOCBAKCxVFSdP95j5m9MshL38eV/E1KXkjbEsQPEbV0ixVSx3i36irIWVgvKXwrzMhg stww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:organization:from:subject:cc:to :dkim-signature:arc-authentication-results; bh=bjC/24gId3soRZelABmvs+E1WYNmWgAQ1bhCoNYz4G8=; b=Q+Fd1G0vPh6tz1CnYLzMRW0vuKpZXi2THA2vfDbLupX1HnH4eFrmSTSV8KMuzd5yb5 M8L+70Jlp0rCsgLqGUURdFYHxqvF+mkYAKVM2gXOCxMaCYfKuENseCkTUgyoCq+IfdGj cyFDt5WrT3NTbY3NJdL3VFmEEAeF8p9vGAgOIYAanOnwA632QsMobNt1CYEW1iIiyoW9 ROsI9PDRm1zbpzLDTRdkMF/OlXl/LBbjajLXd6H1CdjF6EAvM97RmXVya6orwUF0IJM9 nbI75EusuL0+v88VR4ghMzUxqKcDd8+yGsuPioIdMfQQgy0RvDfyROEEtud8tdbZGgAg sJUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=Q9NI87q6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p8si3251444pgn.197.2018.03.01.17.59.18; Thu, 01 Mar 2018 17:59:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=Q9NI87q6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1163731AbeCBBoW (ORCPT + 99 others); Thu, 1 Mar 2018 20:44:22 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:55588 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1163100AbeCBBoS (ORCPT ); Thu, 1 Mar 2018 20:44:18 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w221gYNw000741; Fri, 2 Mar 2018 01:44:14 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=to : cc : subject : from : references : date : in-reply-to : message-id : mime-version : content-type; s=corp-2017-10-26; bh=bjC/24gId3soRZelABmvs+E1WYNmWgAQ1bhCoNYz4G8=; b=Q9NI87q6d7sLn7AMpM6NjEG6VP7a+L6RTo1FNn07ZYlGJKedl2DSm84O3NZFf+vF+hjr 7UphuQzPyQk5u/1nDByG2APLBAmzx7eKUOAJ5FskM0YedcLUHHuTWWy58ODrPfF3VzTN 2TxY5mQKtvRcqkxHqlqnwHlFvoIv7YiWXIG0aIr465FiWs/xF6J7cfQNLVSTwRSQuAoX AwbSZM9dRKalOMlaj6nbI2CEdQgzcTBWP8x7GVKFaP5YkVwIl5QbgpUAzTzDY9S6bnGZ T5JlgexwQMmkkVdvNEmULjzmvTWdCXxoLQQtu871k0xMDEpTJT9MgOMRWeDBtidBPY7v 1w== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2120.oracle.com with ESMTP id 2geubn08v2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 02 Mar 2018 01:44:14 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w221iDsP032472 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 2 Mar 2018 01:44:13 GMT Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w221iDQg003813; Fri, 2 Mar 2018 01:44:13 GMT Received: from ca-mkp.ca.oracle.com (/10.159.214.123) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 01 Mar 2018 17:44:12 -0800 To: Jianchao Wang Cc: jejb@linux.vnet.ibm.com, martin.petersen@oracle.com, Bart.VanAssche@wdc.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Christoph Hellwig Subject: Re: [PATCH V2] scsi: core: use blk_mq_requeue_request in __scsi_queue_insert From: "Martin K. Petersen" Organization: Oracle Corporation References: <1519808113-2863-1-git-send-email-jianchao.w.wang@oracle.com> Date: Thu, 01 Mar 2018 20:44:10 -0500 In-Reply-To: <1519808113-2863-1-git-send-email-jianchao.w.wang@oracle.com> (Jianchao Wang's message of "Wed, 28 Feb 2018 16:55:13 +0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8819 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1803020014 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Jianchao, > In scsi core, __scsi_queue_insert should just put request back on the > queue and retry using the same command as before. However, for blk-mq, > scsi_mq_requeue_cmd is employed here which will unprepare the > request. To align with the semantics of __scsi_queue_insert, use > blk_mq_requeue_request with kick_requeue_list == true and put the > reference of scsi_device. > > V1 -> V2: > - add put_device on scsi_device->sdev_gendev Also, please put changelog after the --- delimiter. > Cc: Christoph Hellwig > Signed-off-by: Jianchao Wang > --- > drivers/scsi/scsi_lib.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c > index a86df9c..6fa7b0c 100644 > --- a/drivers/scsi/scsi_lib.c > +++ b/drivers/scsi/scsi_lib.c > @@ -191,7 +191,8 @@ static void __scsi_queue_insert(struct scsi_cmnd *cmd, int reason, bool unbusy) > */ > cmd->result = 0; > if (q->mq_ops) { > - scsi_mq_requeue_cmd(cmd); > + blk_mq_requeue_request(cmd->request, true); > + put_device(&device->sdev_gendev); > return; > } > spin_lock_irqsave(q->queue_lock, flags); -- Martin K. Petersen Oracle Linux Engineering