Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp372413ybt; Wed, 17 Jun 2020 03:15:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwVoen87G1y93A5ZXBhh2h2nbtD04NNcnPp+xnj+8hb+E4fvuNuZXt1D8brpaJMYPGirpFA X-Received: by 2002:aa7:df05:: with SMTP id c5mr6346384edy.48.1592388911900; Wed, 17 Jun 2020 03:15:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592388911; cv=none; d=google.com; s=arc-20160816; b=xEy1lFojLr9xqd2J0NuM/UFnoHaBcdf2VJq+7+j9Vyhh96yGtx5VeAj9h3S4eF06di 2ffJGmIrpQ92VRJ33q9oZlj5ud0y03EyJ00umQGvuM700ovO4G6xtMepcgrMxvdrQ8uf PI9YhbXEdk9/izchXW5J7F055/V9w72tZjOMdsqyUwMjmzSxJoq3VV2WXtkcXAr/pkX1 x1YHp4jG36vmFR9WjSIHkVqz1+5QlM6qyQVbvLidic+CT3kN+r7AEP6CbKs6+3LCeyKz mgHwPFefLdKoOu597T4ZXKe8OXQT2qKtWV4xD6Y3SEEctVVZHaVu6NE17caYNpcwDaaq RiHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:content-transfer-encoding:date :message-id:in-reply-to:cc:to:from:reply-to:subject:mime-version :dkim-signature:dkim-filter; bh=V7Pmg8P23tSg6zHCQM++ZngYdQm25qEhVAfLSM6EzEg=; b=RQTslOh7UhPsnbDHJykAolJwNsOGcxQXsf/4403lymnjwqXWx4AuikQuGnbNxfS6lJ Xq1qqkeWe0kzf4CO3bbtWpV83i+5+1zQjz5JNuKxK4i+7YxlgPMphtqAfHDHgng+cuyy 7FUyd7KavZBkH28BANGILJhBDcuZ00ya0WW2+fdDqXsXOsAyyT0hxLyncJpkKeO+r46L 8fLfti48JCubFOTKKesyfA0KHR85jHCxEZFeG4ererXbv9sP/4DTr84mlumRt7k4NANa FyDaizqf9qVR5XCIN7CC1UcmQHj68+98KvYMCwhqy7PMTMu96JSkEnqULmNCEuaRJUVi MgVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b="RDT6t/Gv"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f18si12245733ejx.476.2020.06.17.03.14.48; Wed, 17 Jun 2020 03:15:11 -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; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b="RDT6t/Gv"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726510AbgFQKNG (ORCPT + 99 others); Wed, 17 Jun 2020 06:13:06 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:19964 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725860AbgFQKNF (ORCPT ); Wed, 17 Jun 2020 06:13:05 -0400 Received: from epcas1p3.samsung.com (unknown [182.195.41.47]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20200617101302epoutp03d880921ae435d60757ce8d0eb463a57e~ZTSki7j292624126241epoutp03v for ; Wed, 17 Jun 2020 10:13:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20200617101302epoutp03d880921ae435d60757ce8d0eb463a57e~ZTSki7j292624126241epoutp03v DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1592388782; bh=V7Pmg8P23tSg6zHCQM++ZngYdQm25qEhVAfLSM6EzEg=; h=Subject:Reply-To:From:To:CC:In-Reply-To:Date:References:From; b=RDT6t/Gvuw/HuH+5T6OQH1Ame1TlSBkHdguRV2p5DeRVIWNOIIjJDhS+XYgNRF1kT LXETGrheI+oRPRUVC68DDF0RL9rALgVLfJEXsiNB8sN6Dxppp2PjEx9jWEhns6U+P7 N2ZijzUoZLn1lv+Oox5F7I5U+JFUwBVJcnhQxgfE= Received: from epcpadp2 (unknown [182.195.40.12]) by epcas1p3.samsung.com (KnoxPortal) with ESMTP id 20200617101301epcas1p387e3954fd36343176ec3e70dd70a8d45~ZTSkHiDTE1159011590epcas1p3_; Wed, 17 Jun 2020 10:13:01 +0000 (GMT) Mime-Version: 1.0 Subject: RE: [RFC PATCH v2 2/5] scsi: ufs: Add UFS-feature layer Reply-To: daejun7.park@samsung.com From: Daejun Park To: Avri Altman , Daejun Park , ALIM AKHTAR , "jejb@linux.ibm.com" , "martin.petersen@oracle.com" , "asutoshd@codeaurora.org" , "beanhuo@micron.com" , "stanley.chu@mediatek.com" , "cang@codeaurora.org" , "bvanassche@acm.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 X-Priority: 3 X-Content-Kind-Code: NORMAL In-Reply-To: X-CPGS-Detection: blocking_info_exchange X-Drm-Type: N,general X-Msg-Generator: Mail X-Msg-Type: PERSONAL X-Reply-Demand: N Message-ID: <231786897.01592388781837.JavaMail.epsvc@epcpadp2> Date: Wed, 17 Jun 2020 19:09:56 +0900 X-CMS-MailID: 20200617100956epcms2p85d3c46ecb34bebe8c7d6c1c2b3e05589 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: AUTO_CONFIDENTIAL X-CPGSPASS: Y X-CPGSPASS: Y X-Hop-Count: 3 X-CMS-RootMailID: 20200615062708epcms2p19a7fbc051bcd5e843c29dcd58fff4210 References: <336371513.41592205783606.JavaMail.epsvc@epcpadp2> <231786897.01592205482200.JavaMail.epsvc@epcpadp2> <231786897.01592212081335.JavaMail.epsvc@epcpadp2> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > This patch is adding UFS feature layer to UFS core driver. > >=20 > > UFS Driver data structure (struct ufs_hba) > > =E2=94=82 > > =E2=94=8C--------------=E2=94=90 > > =E2=94=82 UFS feature =E2=94=82 <-- HPB module > > =E2=94=82 layer =E2=94=82 <-- other extended feature module > > =E2=94=94--------------=E2=94=98 > > Each extended UFS-Feature module has a bus of ufs-ext feature type. > > The UFS feature layer manages common APIs used by each extended feature > > module. The APIs are set of UFS Query requests and UFS Vendor commands > > related to each extended feature module. > >=20 > > Other extended features can also be implemented using the proposed APIs= . > > For example, in Write Booster, "prep_fn" can be used to guarantee the > > lifetime of UFS by updating the amount of write IO. > > And reset/reset_host/suspend/resume can be used to manage the kernel ta= sk > > for checking lifetime of UFS. > >=20 > > The following 6 callback functions have been added to "ufshcd.c". > > prep_fn: called after construct upiu structure > > reset: called after proving hba > > reset_host: called before ufshcd_host_reset_and_restore > > suspend: called before ufshcd_suspend > > resume: called after ufshcd_resume > > rsp_upiu: called in ufshcd_transfer_rsp_status with SAM_STAT_GOOD state > >=20 > > Signed-off-by: Daejun Park > > --- > > drivers/scsi/ufs/Makefile | 2 +- > > drivers/scsi/ufs/ufsfeature.c | 148 ++++++++++++++++++++++++++++++++++ > > drivers/scsi/ufs/ufsfeature.h | 69 ++++++++++++++++ > > drivers/scsi/ufs/ufshcd.c | 17 ++++ > > drivers/scsi/ufs/ufshcd.h | 3 + > > 5 files changed, 238 insertions(+), 1 deletion(-) > > create mode 100644 drivers/scsi/ufs/ufsfeature.c > > create mode 100644 drivers/scsi/ufs/ufsfeature.h > >=20 > > diff --git a/drivers/scsi/ufs/Makefile b/drivers/scsi/ufs/Makefile > > index 94c6c5d7334b..fe3a92b06c87 100644 > > --- a/drivers/scsi/ufs/Makefile > > +++ b/drivers/scsi/ufs/Makefile > > @@ -5,7 +5,7 @@ obj-$(CONFIG_SCSI_UFS_DWC_TC_PLATFORM) +=3D tc-dwc- > > g210-pltfrm.o ufshcd-dwc.o tc-d > > obj-$(CONFIG_SCSI_UFS_CDNS_PLATFORM) +=3D cdns-pltfrm.o > > obj-$(CONFIG_SCSI_UFS_QCOM) +=3D ufs-qcom.o > > obj-$(CONFIG_SCSI_UFSHCD) +=3D ufshcd-core.o > > -ufshcd-core-y +=3D ufshcd.o ufs-sysfs.o > > +ufshcd-core-y +=3D ufshcd.o ufs-sysfs.o ufsfe= ature.o > How about making it > > ufshcd-core-$(CONFIG_UFS_FEATURES) +=3D ufsfeature.o > So that you won't check none-hpb driver on every response etc. It's not a big problem because it only needs a simple checking. In addition, I think that it is not necessary to separate them because the = UFS feature is enabled in most of the user cases. Thanks, Daejun