Received: by 2002:a05:6512:2355:0:0:0:0 with SMTP id p21csp5525292lfu; Mon, 28 Mar 2022 15:59:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzNE0HLx1J09FKoyly73QCg76aaVxpU/iQuaVUNKSVATaEBXID+W2iFu9wXw9aS4BxFp+RH X-Received: by 2002:a05:6a00:ccf:b0:4fa:abfe:e0f6 with SMTP id b15-20020a056a000ccf00b004faabfee0f6mr25330696pfv.67.1648508372407; Mon, 28 Mar 2022 15:59:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648508372; cv=none; d=google.com; s=arc-20160816; b=pPwJkJOQXpapXlfQXTWXTyciOHaaaBc9CmWDEnphliDNqaX5T27siLTn7YYNYiGU+8 z0B2AXbAHE5nuuaRxmLnT6/BMClQaIZSAakj5doyMWiVCvoDXQ9JWOsjyjgeldvtmoOo 1FciWbl0ayxVvpoFkeXlpkbZWYqbiPviIXKyLj7UGIIzd/4q5Nekt2ZaVDb7z3OsASVN 90tsEmXG5/AWxKfjNyMbn7btAcMVe9i1INnromDXif+QNFjSumjbYdddlVpCcnr25ORi vhLz2jZxJcekyo0LQokH51BLFm7M7Di+B5bfsjsOKFqOQ8njNJdGAOmGxwpvNKYzfkf1 Wcjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=1WPMAzDYaPmtmIt008/qmGn8v8LVwD3l5u9HvqZpH24=; b=SiUsYJmLysGBmUrNeHDI5tkvU16OO/oNQLoa0x9OoKBMwjVph3oZeR0nlhzzBV3yGQ rp3JFoUVDQYX96WGdO+xVWYVMPceNS7nWvXI7xxrSNTasBN1XjYVHvueSau2gaTgvGJf H5XUELpOsuJXXuYEFVAYbE7tqW3KHMZLwwbDhKeXsfkcWKVLr/E1V4YQxsNxB1HOU0bx IxuH9zIBBjnD/Gka06k7zFTZ0OyTCEAuwMz2hIuMcItiJgDHhP7s8wvQDlwMjJ2xw+D3 uR2ZJCATDjOniEAcwD4tpZ1k1faLkkI0tpATUGpVzi31lKsNOd5fbceAbnsSBSCWBJGN UFtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=kvgkl8Ha; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id x195-20020a627ccc000000b004fa3a8e0099si17842706pfc.336.2022.03.28.15.59.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Mar 2022 15:59:32 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=kvgkl8Ha; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2EA782ED52; Mon, 28 Mar 2022 14:58:51 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238382AbiC1Pnh (ORCPT + 99 others); Mon, 28 Mar 2022 11:43:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238328AbiC1Pne (ORCPT ); Mon, 28 Mar 2022 11:43:34 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03E435F27A for ; Mon, 28 Mar 2022 08:41:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1648482114; x=1680018114; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=DBwya0O6Iv5ilAIp5YfXagobpebtXBW/mU7QsBrQeDY=; b=kvgkl8Ha9vkUOnq849820oSGbzG3czu+WKlRY6VsSuBZ4T9aXx2tNSU3 3OcnSVrf9Hj8RwxwhSy4IogYgb4ONcc5W9cSL9GKXG0/Kee+NKPfi+DdB krD5uEuA0kZYLadfBzsw8Xk2j8aN4eekvhVOj7blyN2BLFSV3EzCU6ju9 hd1J1Y/yUVB/xWLIiFTQjpkT12Xf5zqFMADgDzUEgJ1RS1S719v53MPkG OkPJl4RRmaU/7/odaZuAOeu9TPBvjoFyaGz62uR1/Y/nKbTh0lqgSxkUd jPkGsPJ7ypBh5+E4+1RqaMsLmPbeShqbVtppdavWyfMbvK3HfLrtCMear Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10300"; a="283922269" X-IronPort-AV: E=Sophos;i="5.90,217,1643702400"; d="scan'208";a="283922269" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Mar 2022 08:41:53 -0700 X-IronPort-AV: E=Sophos;i="5.90,217,1643702400"; d="scan'208";a="831474393" Received: from allenzho-mobl.amr.corp.intel.com (HELO localhost) ([10.212.109.43]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Mar 2022 08:41:53 -0700 Date: Mon, 28 Mar 2022 08:41:53 -0700 From: Ira Weiny To: "Fabio M. De Francesco" Cc: Greg Kroah-Hartman , Benjamin Philip , Bart Van Assche , "Martin K. Petersen" , Charlie Sands , Mitali Borkar , Colin Ian King , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: rts5208: Convert kmap() to kmap_local_page() Message-ID: References: <20220328112440.17756-1-fmdefrancesco@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220328112440.17756-1-fmdefrancesco@gmail.com> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 28, 2022 at 01:24:40PM +0200, Fabio M. De Francesco wrote: > The use of kmap() is being deprecated and kmap_local_page() is faster. > Use kmap_local_page() in place of kmap(). Thanks for the patch! I have just a couple of comments. kmap_local_page() is not necessarily faster than kmap() but it is more correct in this case. You should mention why. Also to help with kmap_local_page() there are a number of helpers implemented in highmem.h for things like memcpy, memmove, etc. Check out memcpy_page() for this use case. Thank you! Ira > > Signed-off-by: Fabio M. De Francesco > --- > drivers/staging/rts5208/rtsx_transport.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/rts5208/rtsx_transport.c b/drivers/staging/rts5208/rtsx_transport.c > index 805dc18fac0a..de690d7ee5e3 100644 > --- a/drivers/staging/rts5208/rtsx_transport.c > +++ b/drivers/staging/rts5208/rtsx_transport.c > @@ -92,13 +92,13 @@ unsigned int rtsx_stor_access_xfer_buf(unsigned char *buffer, > while (sglen > 0) { > unsigned int plen = min(sglen, (unsigned int) > PAGE_SIZE - poff); > - unsigned char *ptr = kmap(page); > + unsigned char *ptr = kmap_local_page(page); > > if (dir == TO_XFER_BUF) > memcpy(ptr + poff, buffer + cnt, plen); > else > memcpy(buffer + cnt, ptr + poff, plen); > - kunmap(page); > + kunmap_local(ptr); > > /* Start at the beginning of the next page */ > poff = 0; > -- > 2.34.1 >