Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp415127ybt; Sat, 13 Jun 2020 08:26:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxGSd6GnfPrdJLxA2XWJLlzar+zE9Q3tYFdbFjybyNM2vXuRerTjgo5ZGc8Uk2IkdcRi9MM X-Received: by 2002:a17:906:c150:: with SMTP id dp16mr17681261ejc.536.1592061979726; Sat, 13 Jun 2020 08:26:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592061979; cv=none; d=google.com; s=arc-20160816; b=OAc5aIq0q3dhIlXo+xz4DSnGpVsdNvs6BtI+Gw0+mM/rtzOhsnWBi3lnWHWe1ilgiA 96bMPkdyBMytiFXu/652/Z9yHVyFsuPMLpES4D+ReciPDHJ+38XnVq3IHX0w21Kk8nmP yLdCI1zDI/B11r3KDz+5NgWDCrt2aH9tJCl+54Vbn6t19XUsNrF6SEYlmYq72k7ny/VL Su3K0/ThLYkDi1gs7fy/q5d0Ym4xOwW2nWTP+q5r0P8ucw9ZFBBGSwgrknGYH9GKg4Sp dnzgOU3p45EilHylYZndpV0f0Chp3UvDnqvV9DwlV6GJkhiNxemXBJNWYArvAdULtBIP wiXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:from:references:cc:to:subject; bh=UfcBK4H6+ohdNeuGMt6p8le19zTz2XSkp3/CaqQe5O8=; b=XN/BnZR+62989HSwPKmcPESKq0Dw8+m9Bqcaqzf8EUbxM3OCkDDYccsBKegzKn8H7B qQwlmTzFnoTomOCNkPVHebMiu8TBTHwkx8IdafqeVW+odFPBza2Mzqf3HVuhmXuKdd4B GiImo8pX7kE/4986afAuFr6/eHWQYPmqslk3MgsYAKQsnhWTxMyocd+9NdzLaUOKoHHQ /Id50XqAAw1sG4gcwDFLZMj4LWCmf2zc6CyMFCKgaSrvfdwPgBpYyHOlhxPiLnca1QWT HfQ0bcZLxm8Cq0EP6QjGp4YY2lUis1eBby/DSdlc/eT2MPLJC353S/wF5shhq3C+fIZD 6TsA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n26si5920847ejs.688.2020.06.13.08.25.55; Sat, 13 Jun 2020 08:26:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726445AbgFMPYJ (ORCPT + 99 others); Sat, 13 Jun 2020 11:24:09 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:35132 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726323AbgFMPYI (ORCPT ); Sat, 13 Jun 2020 11:24:08 -0400 Received: by mail-pl1-f194.google.com with SMTP id k1so4844837pls.2; Sat, 13 Jun 2020 08:24:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=UfcBK4H6+ohdNeuGMt6p8le19zTz2XSkp3/CaqQe5O8=; b=b7OGMAztATiBMhCEgX89EHKHAhB0BhPFp0ruXbyycH95HZ2cgz5AR7VOxBhlLeRy4e tot4TZJu0PaQgW6rEQuwPEo8K37fIVtbkpRmQP/0UYBAC65yTJCt+LRPxdt8NWauCRF4 KpzlGDdHvfoTTxsY6EPVRwm3QvydJW9F+MITi7i3I1qdycMvuB52ssAgmEKg/mi41cls Wt35aFGle9QG4tBDmN3zSeGeDNWa7/s7vgrsjHw5vcWQrAK2PjmuNSaZp37A+jmb4GIW YlSwf2tVubKYgWblVyPmtYCVG+gmGeMwm7MmKOYxloKV2xehzVdCZ8AidpbeP4DVPbGC BCTw== X-Gm-Message-State: AOAM532yFGb6NnJPdgZaxe8kcaJ6bnOx1QFJFSu7Ge49GbuBCcvji0Xb LSJApl1XctrCRsSuulQh5P4= X-Received: by 2002:a17:90b:283:: with SMTP id az3mr3982512pjb.232.1592061847390; Sat, 13 Jun 2020 08:24:07 -0700 (PDT) Received: from [192.168.50.147] (c-73-241-217-19.hsd1.ca.comcast.net. [73.241.217.19]) by smtp.gmail.com with ESMTPSA id z186sm7963645pgb.93.2020.06.13.08.24.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 13 Jun 2020 08:24:06 -0700 (PDT) Subject: Re: [RFC PATCH 4/5] scsi: ufs: L2P map management for HPB read To: daejun7.park@samsung.com, ALIM AKHTAR , "avri.altman@wdc.com" , "jejb@linux.ibm.com" , "martin.petersen@oracle.com" , "asutoshd@codeaurora.org" , "beanhuo@micron.com" , "stanley.chu@mediatek.com" , "cang@codeaurora.org" , "tomas.winkler@intel.com" Cc: "linux-scsi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Sang-yoon Oh , Sung-Jun Park , yongmyung lee , Jinyoung CHOI , Adel Choi , BoRam Shin References: <0389f9cf-fea8-9990-7699-0e4322728e4a@acm.org> <231786897.01591322101492.JavaMail.epsvc@epcpadp1> <336371513.41591320902369.JavaMail.epsvc@epcpadp1> <963815509.21591320301642.JavaMail.epsvc@epcpadp1> <231786897.01591320001492.JavaMail.epsvc@epcpadp1> <963815509.21591323002276.JavaMail.epsvc@epcpadp1> <963815509.21591934102518.JavaMail.epsvc@epcpadp1> From: Bart Van Assche Autocrypt: addr=bvanassche@acm.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yJDMJ85HVr5rmXG/nqriTh6cv1l1Js T7AFvvPjUPknS6d+BETMhTkbGzoyS+sywEsQAgA+BMCxBH4LvUmHYhpS+W6CiZ3ZMxjO8Hgc ++w1mLeRUvda3i4/U8wDT3SWuHcB3DWlcppECLkAEQEAAYkBHwQYAQIACQUCVI67igIbDAAK CRBxXD01xc4QCZ4dB/0QrnEasxjM0PGeXK5hcZMT9Eo998alUfn5XU0RQDYdwp6/kMEXMdmT oH0F0xB3SQ8WVSXA9rrc4EBvZruWQ+5/zjVrhhfUAx12CzL4oQ9Ro2k45daYaonKTANYG22y //x8dLe2Fv1By4SKGhmzwH87uXxbTJAUxiWIi1np0z3/RDnoVyfmfbbL1DY7zf2hYXLLzsJR mSsED/1nlJ9Oq5fALdNEPgDyPUerqHxcmIub+pF0AzJoYHK5punqpqfGmqPbjxrJLPJfHVKy goMj5DlBMoYqEgpbwdUYkH6QdizJJCur4icy8GUNbisFYABeoJ91pnD4IGei3MTdvINSZI5e Message-ID: <6d570594-96f8-764e-e252-97a714731650@acm.org> Date: Sat, 13 Jun 2020 08:24:04 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <963815509.21591934102518.JavaMail.epsvc@epcpadp1> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-06-11 20:37, Daejun Park wrote: >>> +static int ufshpb_execute_map_req(struct ufshpb_lu *hpb, >>> + struct ufshpb_req *map_req) >>> +{ >>> + struct request_queue *q; >>> + struct request *req; >>> + struct scsi_request *rq; >>> + int ret = 0; >>> + >>> + q = hpb->sdev_ufs_lu->request_queue; >>> + ret = ufshpb_map_req_add_bio_page(hpb, q, map_req->bio, >>> + map_req->mctx); >>> + if (ret) { >>> + dev_notice(&hpb->hpb_lu_dev, >>> + "map_req_add_bio_page fail %d - %d\n", >>> + map_req->rgn_idx, map_req->srgn_idx); >>> + return ret; >>> + } >>> + >>> + req = map_req->req; >>> + >>> + blk_rq_append_bio(req, &map_req->bio); >>> + req->rq_flags |= RQF_QUIET; >>> + req->timeout = MAP_REQ_TIMEOUT; >>> + req->end_io_data = (void *)map_req; >>> + >>> + rq = scsi_req(req); >>> + ufshpb_set_read_buf_cmd(rq->cmd, map_req->rgn_idx, >>> + map_req->srgn_idx, hpb->srgn_mem_size); >>> + rq->cmd_len = HPB_READ_BUFFER_CMD_LENGTH; >>> + >>> + blk_execute_rq_nowait(q, NULL, req, 1, ufshpb_map_req_compl_fn); >>> + >>> + atomic_inc(&hpb->stats.map_req_cnt); >>> + return 0; >>> +} >> >> Why a custom timeout instead of the SCSI LUN timeout? > > There was no suitable timeout value to use. I've included sd.h, so I'll > use sd_timeout. Wouldn't that be a layering violation? The UFS driver is a SCSI LLD driver and the sd driver is a SCSI ULD. A SCSI LLD must not make any assumptions about which ULD driver has been attached. How about leaving req->timeout zero such that blk_add_timer() sets it? blk_add_timer() is called by blk_mq_start_request(). From blk_add_timer(): if (!req->timeout) req->timeout = q->rq_timeout; Thanks, Bart.