Received: by 10.213.65.68 with SMTP id h4csp642344imn; Fri, 6 Apr 2018 06:38:40 -0700 (PDT) X-Google-Smtp-Source: AIpwx487mgtw3LBjYm4H1xlo3f0TLQQmwCpcg4HQPbmp4AWUITI/9VWANoC81GyY7jycGikvX3nC X-Received: by 10.99.113.25 with SMTP id m25mr18006568pgc.164.1523021920698; Fri, 06 Apr 2018 06:38:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523021920; cv=none; d=google.com; s=arc-20160816; b=Okzapi1TJGkLTCs6VHWP/f4rlPdxRO7hHF700ok3SYkk5+D+sdWsvV+cMCNJ4/doJr 9yyeVSdvXNHJyHq0qKSxH27fKC30OQrElWrAkXjYo1hYH86o8U6CvaH/7Q+Oab9Tr9f2 8/m8UGz3iqCQbo47ApdO7y6jmULQDoOc6gKhaKpFQyV+i7CEPf05jGotgkZrNN2gJXUZ H/8FyZNwNDkyF4xTfTPW2u+4iWzlkkbpJ2QXt4K0d+0cRRUBhpcqrhZm+iy4NaZ7kVBL hRmwDs+73eg8o5q3MRo79TH6J1YfmFKlv6g4LZj5CDbh+fDfc93d1nLPORjFvhGGp1Th cQIg== 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:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=B1IG4IfjeqQU4ywP05fatB7S0s0SCx/5mKswlztk7QI=; b=McwRtYrcgB13y3i0z0Vj7B3HbD1Ia1VfcMQTbFiRjVRLzSGG0QRZUUf8d8nxie7rs0 vX/lGCB822oIuZLirygZ/JpyEL6Do1chrRrpAqcZ2MmM80gSH9G54MvkA4IQbLVIIWx+ apnPF5kmM83TBhJE/FR2W3lAHg+PybWx/nIgP7ykuiprt2R0+CcrjnexqmErNSudlM/X S67ol0svVrMVa7Sz/uVJYFB+bfHva+NieDaCWC2XU5lr4pJjpPKuP5yuQSZQRarq18WE +AbEfvr5ZJQOwgDKted4eQiBWbRK8HWMVYrKwdVl2nomV+eaQr1EXdOsYY6BSrR5JhaS 5hJA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b8-v6si10924720pla.272.2018.04.06.06.38.26; Fri, 06 Apr 2018 06:38:40 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932206AbeDFNhJ (ORCPT + 99 others); Fri, 6 Apr 2018 09:37:09 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:60458 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932194AbeDFNhH (ORCPT ); Fri, 6 Apr 2018 09:37:07 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id D4CC2CAE; Fri, 6 Apr 2018 13:36:55 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ben Hutchings , Ming Lei , Jens Axboe , Sasha Levin Subject: [PATCH 4.9 100/102] Revert "mtip32xx: use runtime tag to initialize command header" Date: Fri, 6 Apr 2018 15:24:21 +0200 Message-Id: <20180406084345.447939757@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180406084331.507038179@linuxfoundation.org> References: <20180406084331.507038179@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Greg Kroah-Hartman This reverts commit db54facd56a40e7766bf7f7cda1ae138e72a691c which was commit a4e84aae8139aca9fbfbced1f45c51ca81b57488 upstream. Ben writes: MQ IO schedulers were introduced in 4.11, so this shouldn't be needed in older branches. It also causes a performance regression (fixed upstream). Please revert this for 4.4 and 4.9. So let's revert it! Reported-by: Ben Hutchings Cc: Ming Lei Cc: Jens Axboe Cc: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/block/mtip32xx/mtip32xx.c | 36 ++++++++++++------------------------ 1 file changed, 12 insertions(+), 24 deletions(-) --- a/drivers/block/mtip32xx/mtip32xx.c +++ b/drivers/block/mtip32xx/mtip32xx.c @@ -169,25 +169,6 @@ static bool mtip_check_surprise_removal( return false; /* device present */ } -/* we have to use runtime tag to setup command header */ -static void mtip_init_cmd_header(struct request *rq) -{ - struct driver_data *dd = rq->q->queuedata; - struct mtip_cmd *cmd = blk_mq_rq_to_pdu(rq); - u32 host_cap_64 = readl(dd->mmio + HOST_CAP) & HOST_CAP_64; - - /* Point the command headers at the command tables. */ - cmd->command_header = dd->port->command_list + - (sizeof(struct mtip_cmd_hdr) * rq->tag); - cmd->command_header_dma = dd->port->command_list_dma + - (sizeof(struct mtip_cmd_hdr) * rq->tag); - - if (host_cap_64) - cmd->command_header->ctbau = __force_bit2int cpu_to_le32((cmd->command_dma >> 16) >> 16); - - cmd->command_header->ctba = __force_bit2int cpu_to_le32(cmd->command_dma & 0xFFFFFFFF); -} - static struct mtip_cmd *mtip_get_int_command(struct driver_data *dd) { struct request *rq; @@ -199,9 +180,6 @@ static struct mtip_cmd *mtip_get_int_com if (IS_ERR(rq)) return NULL; - /* Internal cmd isn't submitted via .queue_rq */ - mtip_init_cmd_header(rq); - return blk_mq_rq_to_pdu(rq); } @@ -3833,8 +3811,6 @@ static int mtip_queue_rq(struct blk_mq_h struct request *rq = bd->rq; int ret; - mtip_init_cmd_header(rq); - if (unlikely(mtip_check_unal_depth(hctx, rq))) return BLK_MQ_RQ_QUEUE_BUSY; @@ -3866,6 +3842,7 @@ static int mtip_init_cmd(void *data, str { struct driver_data *dd = data; struct mtip_cmd *cmd = blk_mq_rq_to_pdu(rq); + u32 host_cap_64 = readl(dd->mmio + HOST_CAP) & HOST_CAP_64; /* * For flush requests, request_idx starts at the end of the @@ -3882,6 +3859,17 @@ static int mtip_init_cmd(void *data, str memset(cmd->command, 0, CMD_DMA_ALLOC_SZ); + /* Point the command headers at the command tables. */ + cmd->command_header = dd->port->command_list + + (sizeof(struct mtip_cmd_hdr) * request_idx); + cmd->command_header_dma = dd->port->command_list_dma + + (sizeof(struct mtip_cmd_hdr) * request_idx); + + if (host_cap_64) + cmd->command_header->ctbau = __force_bit2int cpu_to_le32((cmd->command_dma >> 16) >> 16); + + cmd->command_header->ctba = __force_bit2int cpu_to_le32(cmd->command_dma & 0xFFFFFFFF); + sg_init_table(cmd->sg, MTIP_MAX_SG); return 0; }