Received: by 10.213.65.68 with SMTP id h4csp3853027imn; Tue, 3 Apr 2018 11:47:48 -0700 (PDT) X-Google-Smtp-Source: AIpwx49wZf2SAr9GScpSaC1OlUWXWgqLMbTs/QKeoNEcdyL0OR3GX2/LDtreChexYbnn/yK/M6eQ X-Received: by 2002:a17:902:2983:: with SMTP id h3-v6mr15592670plb.80.1522781268460; Tue, 03 Apr 2018 11:47:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522781268; cv=none; d=google.com; s=arc-20160816; b=xpbU5hFpXbiR43dxOdgLq9v6joq9S5q0ewNMPzITu7+Uxik9oZ1biLJ0aqz71IHG7u v+aWIfl4zrtwctHJeS5q03c1nkxPvbS17B8q2SgfWMYdMO/boBGlcMvXyig9nT1GPRlc fx8la2vUJEz/veSgXtJ9Zoi/irf1loQrzoArIF3/0jWAFUj7lxVKpmqUEvCKGFlgCnaI kqD3grLzJXcD/D47ygB1VQtrLRNxKpAJpo3sOl659GOd0qjX1pkPwSev8XHw/w5vEdyh bISu9XrolaHWIBqesD2xLqoZhVQ62Vo0+FUtX+q8/JLclzaloZQpVbZSh8Nhz2BBqXQP HdJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:reply-to:dkim-signature :arc-authentication-results; bh=VdDTk67TcoDRWDUJZ4fN6QVSRDOaLf+Lla3HyH0dtHk=; b=g1xtcDjPv56v34P4R7WgjDomjj6nGhpw0Hz6mjduQ7ORd90asXkU0jgKCn2IiLon7S 8bC2+V10rKQWY9fFyaDdqDYKOAMjHykfUFbgbFU2XjAKhhFFiN8R6raDVUJrL3txO2mS TgzrClW3U+kyP4qkgObwWrnT4vvNq+YVsS2Jsj5kStMjmltx6Os9bLAxwyMnGcPpLQtr JCnePcBDSgG+EVhtek+qmQUH/MVwMj8asrKQctbUk0QNxIz+cbZhYvKoVURDM72b9aXt mi9K+lOrP8rjI7ZVdVHGShgRGo8vkXfbdOolOcqqLu/Ig0bY5Dkj2scc0kn6r36qr3Aw Tm1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=XttTNnYw; 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 n24si2570472pff.382.2018.04.03.11.47.21; Tue, 03 Apr 2018 11:47:48 -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; dkim=fail header.i=@gmail.com header.s=20161025 header.b=XttTNnYw; 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 S1752880AbeDCSpP (ORCPT + 99 others); Tue, 3 Apr 2018 14:45:15 -0400 Received: from mail-pl0-f65.google.com ([209.85.160.65]:36363 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752320AbeDCSpO (ORCPT ); Tue, 3 Apr 2018 14:45:14 -0400 Received: by mail-pl0-f65.google.com with SMTP id 91-v6so10083224pld.3 for ; Tue, 03 Apr 2018 11:45:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:reply-to:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=VdDTk67TcoDRWDUJZ4fN6QVSRDOaLf+Lla3HyH0dtHk=; b=XttTNnYwyqFZbzeEdwh4MDrfOXzmcmxe9x10dj7510TGDqcDt0VoC++8Ix7cwW2+u+ NRuSYJXy0m7E0RN9Ikw7p3joOVXh0QoOOn5WoSSG56jJZp/4FDu6SDRdlXyF1oub5bks 7DwOhIyRiWSUXsoxZ4xDJ4e5/SVUhn0kIWGUNUtdgKt7BN+47s+hKbvTpSTg5hAi2h1H l9nDq9w5z+X91Zbbtim9h4RGlEeougEK3jsFE3Z08dKDxmeDJzaYMXb1y70WLs7geOx8 hl37pce6GXWNa3xEuRJ+cnMWNzQjtDD53TVNxQRZNxm0t9VErvhsyob8fNXz1o5JG/IW 2Snw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:reply-to:subject:to:references:from :message-id:date:user-agent:mime-version:in-reply-to :content-transfer-encoding:content-language; bh=VdDTk67TcoDRWDUJZ4fN6QVSRDOaLf+Lla3HyH0dtHk=; b=Q+cPNjdicILCvaLV5oNba1a6sFvnKFhOMd3Nc6sIghUBybhQgkSGLMiGfMFgeWEjYV TaDLhnY0A/Xq1o+fOOnEZXpeNfq6C74d8LuC9I+cfSyDaCxx/CD+k8Q/mjafPQFVWl+L 87WFBR55v6OpNTRClVtsEgOw+FeUkWeWFtLdczPEzweayfKEj6wZFfszje5Hik/Bh75N x5Hy075djPkobDk++8PufcwY/cX6XllnvGngpBF9yEzYTSYpL43csDTDpKOcdMWwX4NW lGHUDRc3p+YG+wi/gIM5CZFWmOLjpEhjHcxmcx8b//JbZP7BDlHfojTLf58YgT4eIADm umpA== X-Gm-Message-State: ALQs6tDDgNykTXwEiTdHwYGMQJChguyH48iNV+Ehng16SyBT/7xKLAYL 0kPirrXrmwK3XMJ3Hdh0tA== X-Received: by 2002:a17:902:7798:: with SMTP id o24-v6mr4534133pll.349.1522781113623; Tue, 03 Apr 2018 11:45:13 -0700 (PDT) Received: from serve.minyard.net ([47.184.168.85]) by smtp.gmail.com with ESMTPSA id j11sm6365719pgs.13.2018.04.03.11.45.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Apr 2018 11:45:12 -0700 (PDT) Received: from [192.168.27.3] (t430m.minyard.net [192.168.27.3]) by serve.minyard.net (Postfix) with ESMTPSA id 1B67E662; Tue, 3 Apr 2018 13:45:11 -0500 (CDT) Reply-To: minyard@acm.org Subject: Re: [PATCH ipmi/kcs_bmc v1] ipmi: kcs_bmc: optimize the data buffers allocation To: "Wang, Haiyue" , openipmi-developer@lists.sourceforge.net, linux-kernel@vger.kernel.org References: <1521116452-4993-1-git-send-email-haiyue.wang@linux.intel.com> <50ba7cd8-0e14-d8b7-a10c-5dee17946722@linux.intel.com> From: Corey Minyard Message-ID: <143afdd1-bdde-fb9b-d21c-8dc8eeb24e6c@acm.org> Date: Tue, 3 Apr 2018 13:45:10 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <50ba7cd8-0e14-d8b7-a10c-5dee17946722@linux.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/03/2018 01:00 AM, Wang, Haiyue wrote: > Hi Corey, > > The 4.17 merge window is opened now, this patch is not yet in > linux-next tree, > > so it will be merged into 4.18 ? > Yeah, this came in kind of late, and I had some other critical things I was having to focus on, so I've been kind of out of the loop. If it's urgent, I can work on getting it into 4.17 later, but I'd rather wait on 4.18. -corey > Thanks & Regards, > > Haiyue > > On 2018-03-15 20:20, Haiyue Wang wrote: >> Allocate a continuous memory block for the three KCS data buffers with >> related index assignment. >> >> Signed-off-by: Haiyue Wang >> --- >>   drivers/char/ipmi/kcs_bmc.c | 10 ++++++---- >>   1 file changed, 6 insertions(+), 4 deletions(-) >> >> diff --git a/drivers/char/ipmi/kcs_bmc.c b/drivers/char/ipmi/kcs_bmc.c >> index fbfc05e..dc19c0d 100644 >> --- a/drivers/char/ipmi/kcs_bmc.c >> +++ b/drivers/char/ipmi/kcs_bmc.c >> @@ -435,6 +435,7 @@ static const struct file_operations kcs_bmc_fops = { >>   struct kcs_bmc *kcs_bmc_alloc(struct device *dev, int sizeof_priv, >> u32 channel) >>   { >>       struct kcs_bmc *kcs_bmc; >> +    void *buf; >>         kcs_bmc = devm_kzalloc(dev, sizeof(*kcs_bmc) + sizeof_priv, >> GFP_KERNEL); >>       if (!kcs_bmc) >> @@ -448,11 +449,12 @@ struct kcs_bmc *kcs_bmc_alloc(struct device >> *dev, int sizeof_priv, u32 channel) >>       mutex_init(&kcs_bmc->mutex); >>       init_waitqueue_head(&kcs_bmc->queue); >>   -    kcs_bmc->data_in = devm_kmalloc(dev, KCS_MSG_BUFSIZ, GFP_KERNEL); >> -    kcs_bmc->data_out = devm_kmalloc(dev, KCS_MSG_BUFSIZ, GFP_KERNEL); >> -    kcs_bmc->kbuffer = devm_kmalloc(dev, KCS_MSG_BUFSIZ, GFP_KERNEL); >> -    if (!kcs_bmc->data_in || !kcs_bmc->data_out || !kcs_bmc->kbuffer) >> +    buf = devm_kmalloc_array(dev, 3, KCS_MSG_BUFSIZ, GFP_KERNEL); >> +    if (!buf) >>           return NULL; >> +    kcs_bmc->data_in  = buf; >> +    kcs_bmc->data_out = buf + KCS_MSG_BUFSIZ; >> +    kcs_bmc->kbuffer  = buf + KCS_MSG_BUFSIZ * 2; >>         kcs_bmc->miscdev.minor = MISC_DYNAMIC_MINOR; >>       kcs_bmc->miscdev.name = dev_name(dev); >