Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp815443imu; Fri, 4 Jan 2019 07:40:52 -0800 (PST) X-Google-Smtp-Source: AFSGD/U46uym06B09uHpF5H14XN+rDxL+HE2/IvNfe//2mx0OrZCjsQgSzrsUbT8WIcoP4tpD+/9 X-Received: by 2002:a62:6f49:: with SMTP id k70mr52482740pfc.7.1546616452045; Fri, 04 Jan 2019 07:40:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546616452; cv=none; d=google.com; s=arc-20160816; b=KWKxlln5YAXKEOlLYxvtIXidZ4ufb9csPr1pgGxPgR91LcYbxKBFHioFsC+5oJ5pyU ZN+SzCWRrzVW2qqohd7yGULFq92M2Dv2KwLy/HxW4W4wDkHyIPPjztD1lWFzD3UIaDjl cW4MGrkMYd4TvWKhWGg4pD7Jq4ceodK/JMROFRZ1C/qAeEngQumtdNFUwGEKoSGL51bO QnXkM1TzNbVLOyvHw1pjA9AVKhQz4mSndY/L27+nhrXlHkCaxv+QdPFvKAcb8XTZ3IMl 2ohkLQ1NTAkAwM/74kkNkd+bRJ517c5WQXtaRxsKHBfJNLUgGUx0pJiXY5izG1Au369C 4WDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=AycUfNSJycQhs83XV0Xsk3/MJF6stOLOivW4qLS2vBw=; b=d77ABmBJKNZ2+IIh9Va3T6MXFw1rL72T3XSg/LaGFy3l0MD8yYYj4VRJIIHhLY+t8y 8scTFGCmv1SgnRrzj6B642Rk9ZY0U4+iYP5BsTAGYv8zPDrqHN4p3Mp6OYIVQTq3S2h0 iPdYzG2LFRAzdvnQRcrTTEyWiTU1lbMhw+kyzVF/2A/PTgL3VpYgBqFeUfm4L3Obz5ii Rd+mMDOGaQSTLQc3pRVBgOtd5X6fanuNDY28Fm+13ImG7bv7EKqZOiirxdFqwqYq29Z0 dMMHLOvPAbJkgGIdonFrMVKZzDNFd902hcb42NzJ/+If8w5aSn5/tWPnFxG6EP2tIs5h xhBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BCuP2NqE; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z188si37940262pgb.330.2019.01.04.07.40.18; Fri, 04 Jan 2019 07:40:51 -0800 (PST) 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=pass header.i=@gmail.com header.s=20161025 header.b=BCuP2NqE; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727492AbfADMtr (ORCPT + 99 others); Fri, 4 Jan 2019 07:49:47 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:45206 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726323AbfADMtr (ORCPT ); Fri, 4 Jan 2019 07:49:47 -0500 Received: by mail-pl1-f196.google.com with SMTP id a14so17396552plm.12; Fri, 04 Jan 2019 04:49:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=AycUfNSJycQhs83XV0Xsk3/MJF6stOLOivW4qLS2vBw=; b=BCuP2NqEgiwxHKx7B2JvLiD2fOEEkSHGs8lTByP45e/an7L/V/BD7wBlWolZSG8aNr Fz20ltIDDDzYBt0iyIl+wmmHBSnqkOaWZmfxvYtWvk27wmOCIS/aLjmLky3bmsTvwfJ2 1bz4RJKAIM6ErMN/bB6/ugrezfQChuKe1lFAMJ2BOE20CKCULrRI6PhjSbAus+LZcmY0 h4OOS1hTRHqOMRkviazUYZ2YSwl+qWL6kFwpeLcC8QZFVeZT/tZyTs7TFMe4lSm/Uksz uJpf2D8Q3eEFV2MrwjZDhQa58DE1zUGp7VwADcO/ZiVS2gQjBUwMXNbz9Q+CpNHAstzp LVJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=AycUfNSJycQhs83XV0Xsk3/MJF6stOLOivW4qLS2vBw=; b=F/VcouJkXRajCj9ThiFaUGAAvfpGdUHK7DHTCYaD1VhNfI3MQjAXrSmLgrmCere4Cd hxvPclG6ZbyDO3qE7w7ZXuiGux2zEvaynzbhPWfq3AVCqQmO7NxngimMUfpsSxFimTT+ pk7EjvVbor/19HSlZzmlUqZFYXzu/vwkUmSU6Qaq0qWhVfnClWnmCV81Rgu3SzYhLJg9 0MsJ2iFkMXqYyq1XkPDNmug8wor2o64sMKApoYKri89ZfXv5nQUbxcQWCIbeTSgaHqrh gWY7gGNgmztrrXpQQgxpLOZRlfny5Sym0AvmWMIxJgENqZeJvjP6CPOkRC5Ov/BbMswh XlUA== X-Gm-Message-State: AJcUukdq3v2CduaYSKpy9YsfKm6ueLKshaVAuOJular9OdO+bKjL00Mg 7HPLGktpOtCW03ctaTt4huY9J80KfNSW4XogLg4= X-Received: by 2002:a17:902:9f89:: with SMTP id g9mr51296219plq.214.1546606186008; Fri, 04 Jan 2019 04:49:46 -0800 (PST) MIME-Version: 1.0 References: <5bf00de4.1c69fb81.7dd65.5785@mx.google.com> In-Reply-To: From: Sabyasachi Gupta Date: Fri, 4 Jan 2019 18:19:34 +0530 Message-ID: Subject: Re: [PATCH] scsi/dpt_i2o.c: Use dma_zalloc_coherent To: aacraid@microsemi.com, jejb@linux.vnet.ibm.com, martin.petersen@oracle.com Cc: Souptick Joarder , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Brajeswar Ghosh Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 19, 2018 at 6:41 PM Sabyasachi Gupta wrote: > > On Sat, Dec 1, 2018 at 6:45 PM Sabyasachi Gupta > wrote: > > > > On Sat, Nov 17, 2018 at 6:17 PM Sabyasachi Gupta > > wrote: > > > > > > Replaced dma_alloc_coherent + memset with dma_zalloc_coherent > > > > > > Signed-off-by: Sabyasachi Gupta > > > > Any comment on this patch? > > Any comment on this patch? > Any comment on this patch? > > > > > --- > > > drivers/scsi/dpt_i2o.c | 12 ++++-------- > > > 1 file changed, 4 insertions(+), 8 deletions(-) > > > > > > diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c > > > index 37de8fb..056383a 100644 > > > --- a/drivers/scsi/dpt_i2o.c > > > +++ b/drivers/scsi/dpt_i2o.c > > > @@ -1370,13 +1370,12 @@ static s32 adpt_i2o_reset_hba(adpt_hba* pHba) > > > schedule_timeout_uninterruptible(1); > > > } while (m == EMPTY_QUEUE); > > > > > > - status = dma_alloc_coherent(&pHba->pDev->dev, 4, &addr, GFP_KERNEL); > > > + status = dma_zalloc_coherent(&pHba->pDev->dev, 4, &addr, GFP_KERNEL); > > > if(status == NULL) { > > > adpt_send_nop(pHba, m); > > > printk(KERN_ERR"IOP reset failed - no free memory.\n"); > > > return -ENOMEM; > > > } > > > - memset(status,0,4); > > > > > > msg[0]=EIGHT_WORD_MSG_SIZE|SGL_OFFSET_0; > > > msg[1]=I2O_CMD_ADAPTER_RESET<<24|HOST_TID<<12|ADAPTER_TID; > > > @@ -2836,14 +2835,13 @@ static s32 adpt_i2o_init_outbound_q(adpt_hba* pHba) > > > > > > msg=(u32 __iomem *)(pHba->msg_addr_virt+m); > > > > > > - status = dma_alloc_coherent(&pHba->pDev->dev, 4, &addr, GFP_KERNEL); > > > + status = dma_zalloc_coherent(&pHba->pDev->dev, 4, &addr, GFP_KERNEL); > > > if (!status) { > > > adpt_send_nop(pHba, m); > > > printk(KERN_WARNING"%s: IOP reset failed - no free memory.\n", > > > pHba->name); > > > return -ENOMEM; > > > } > > > - memset(status, 0, 4); > > > > > > writel(EIGHT_WORD_MSG_SIZE| SGL_OFFSET_6, &msg[0]); > > > writel(I2O_CMD_OUTBOUND_INIT<<24 | HOST_TID<<12 | ADAPTER_TID, &msg[1]); > > > @@ -2890,14 +2888,13 @@ static s32 adpt_i2o_init_outbound_q(adpt_hba* pHba) > > > pHba->reply_pool, pHba->reply_pool_pa); > > > } > > > > > > - pHba->reply_pool = dma_alloc_coherent(&pHba->pDev->dev, > > > + pHba->reply_pool = dma_zalloc_coherent(&pHba->pDev->dev, > > > pHba->reply_fifo_size * REPLY_FRAME_SIZE * 4, > > > &pHba->reply_pool_pa, GFP_KERNEL); > > > if (!pHba->reply_pool) { > > > printk(KERN_ERR "%s: Could not allocate reply pool\n", pHba->name); > > > return -ENOMEM; > > > } > > > - memset(pHba->reply_pool, 0 , pHba->reply_fifo_size * REPLY_FRAME_SIZE * 4); > > > > > > for(i = 0; i < pHba->reply_fifo_size; i++) { > > > writel(pHba->reply_pool_pa + (i * REPLY_FRAME_SIZE * 4), > > > @@ -3126,13 +3123,12 @@ static int adpt_i2o_build_sys_table(void) > > > sys_tbl_len = sizeof(struct i2o_sys_tbl) + // Header + IOPs > > > (hba_count) * sizeof(struct i2o_sys_tbl_entry); > > > > > > - sys_tbl = dma_alloc_coherent(&pHba->pDev->dev, > > > + sys_tbl = dma_zalloc_coherent(&pHba->pDev->dev, > > > sys_tbl_len, &sys_tbl_pa, GFP_KERNEL); > > > if (!sys_tbl) { > > > printk(KERN_WARNING "SysTab Set failed. Out of memory.\n"); > > > return -ENOMEM; > > > } > > > - memset(sys_tbl, 0, sys_tbl_len); > > > > > > sys_tbl->num_entries = hba_count; > > > sys_tbl->version = I2OVERSION; > > > -- > > > 2.7.4 > > >