Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp5573750pxb; Mon, 28 Mar 2022 14:25:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZ16J7sqmOj0Aj6U8GPiyeRpIiJeXnEfI07VhRVpmIjgYJ3+JXYYzOqKKmz12c3uMf8Mp2 X-Received: by 2002:a05:6808:2117:b0:2da:5906:22c3 with SMTP id r23-20020a056808211700b002da590622c3mr640486oiw.80.1648502701485; Mon, 28 Mar 2022 14:25:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648502701; cv=none; d=google.com; s=arc-20160816; b=Xbu3uQ+nZS/OBUSP5/4TINnpY0kudEk0L0+YmZ2bDsbNZXlENuJAz4iMAIrfhw9ZVU 0BywJHG/jpSVgAxs4FkXlZl2kj3gpdrVAyoXD1oju90bg5/0rJYE+0plOI5ENSAVOVPr C1cymxPCcWxonNyZJlddk0M2KMnzlw632UGqE6s5pd/bD7F40MErgpDRKm3o9w434xXT vuEHRkqLoHjktf0MYfa/ckVcs8b9yxr7/cGpSs+/hFchqpOfrSjciYUKZAipD9ex7IXB sR8Dz+Pjs6+mDyL54kPItkwKYNP73qaSBTnOzvusELkGc/7zkCv1pgaztILzlDpJ9qjd XlMg== 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=Yww+sznzlg+9c/10wBI2RUwiATfrUv8u0PoHBO8kdnA=; b=x7t0lP1ffXLQkPmYn/RDxFhTOkEMw+SfMLGjMxoO1grRGESXIJThxwjWdCNMd5mB4R FJz3wDWFKteoogHULGyCP5wvWuE5AECq8Uut8m3vniJMVGv2+vAddRJG/ScEt8hpQ1zj ANZ03VTgHgM8M7kDff8+6jrB46BWYZ0fhX6pfYNf8SHhCwzzSPxU848ECPR8SSzdpwB1 aUJ8GYRDVTSjUn9bvXazgVy45ObFQMGC9kferBOFjtbtN1waLW/S+hB7mDxGlvjzq96O wz31/gfVAR4TmIOatEbv4nZNw3kfZ9OqRH9iXNqb2d7la1wYhHPVvB8bChqXLX4BJCHg 9LaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=TZl93Yn4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id z7-20020a056870e30700b000de0898ec4fsi8076780oad.133.2022.03.28.14.25.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Mar 2022 14:25:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=TZl93Yn4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 1C41F30568; Mon, 28 Mar 2022 14:09:32 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241613AbiC1QOY (ORCPT + 99 others); Mon, 28 Mar 2022 12:14:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241597AbiC1QOX (ORCPT ); Mon, 28 Mar 2022 12:14:23 -0400 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0252562A21 for ; Mon, 28 Mar 2022 09:12:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1648483962; x=1680019962; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=1K00Uy2bjZkVdoEOhcJO6s0f7diS2FE9HUV9VPPi8yw=; b=TZl93Yn4/jB/6jAmw+awVAIe3zA9FqmIHYS8WzRgwpdkdSk1vtKH5tuN tPQS7ya64oScLop8FicBnVgfeBj7lkvW2y0TOW8/7sBuZeD1eDfcmCqiO 8ISRij/bFIZNUq5kHoJ6iCBtQkxbbsR6jyofZVhVvXH+n2YOtqg4h1Q/H C5CrShAi6LiDp2gZG3FaRVqxvr4DcAGjk1FtK3Y6MZzkBk2t+A+hgKdTm aFmaFHXMMPUoVHArym+BFmIx/oUGUfleiW6GhNVkMuRXTkyepgZCONPgB /RRJWrkGB6zdNmNWz7BiOOWG7d+sIfow5ozSNNdjyR8ANcooCijJaF9KT A==; X-IronPort-AV: E=McAfee;i="6200,9189,10300"; a="241195781" X-IronPort-AV: E=Sophos;i="5.90,217,1643702400"; d="scan'208";a="241195781" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Mar 2022 09:11:58 -0700 X-IronPort-AV: E=Sophos;i="5.90,217,1643702400"; d="scan'208";a="521075979" Received: from allenzho-mobl.amr.corp.intel.com (HELO localhost) ([10.212.109.43]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Mar 2022 09:11:57 -0700 Date: Mon, 28 Mar 2022 09:11:56 -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, iweiny@gmail.com, ira.weiny@intel.com 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: 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 08:41:53AM -0700, Ira Weiny wrote: > 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 > Also I believe this is work toward the Outreachy program. If so be sure to follow the guidelines on this page: https://kernelnewbies.org/Outreachyfirstpatch In particular, it does not look like you cc'ed the Outreachy list. Thanks! 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 > >