From patchwork Tue Jan 17 09:06:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ye.xingchen@zte.com.cn X-Patchwork-Id: 44600 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1651495wrn; Tue, 17 Jan 2023 01:19:48 -0800 (PST) X-Google-Smtp-Source: AMrXdXsehTd44bpNpy242IhEOAqCjYRzWo2MGTWyZYfwb/fMGt5QWHQRTx+0mmN2+WzsRjl/Wrl+ X-Received: by 2002:aa7:dd4a:0:b0:499:d297:334e with SMTP id o10-20020aa7dd4a000000b00499d297334emr2502956edw.20.1673947188638; Tue, 17 Jan 2023 01:19:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673947188; cv=none; d=google.com; s=arc-20160816; b=NyNSQr3uXsaKNlyeis1fh3z0GSvn61FaJ3X1WE7mLu/TQOKCbyJgd1IemTibezWyVf 133lgbNBab7uSIFh6B7UAYk9ceEvdIE5MdnpXqJONvAZngyw882dYsD37VPp6SPqc8Hg KwTg6nzWo0YuraQvt+fgR94ySBuTXYC+7DxU/1gMBS2M2gP78+KDFfEhCwU4ZfVOPoDr EkuW+15qYA5h26mMPb7KM7iSMRJ6jQJdFPtSaDeE1afvU8Y5O3XTut37TfqQNLYp/Z/V 87WePJbIZTHZ4iEzGnX31INL4YD8CAuFYIui+Q8+AsI9nsuf1qi+egSRENhsrGGo6CiC 2LLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:mime-version:message-id:date; bh=LehskfDBjGtxl4+Q2M7F3OWWv1Fj40eoBR0QRoHYpFM=; b=Jvgxy+9GH12cSKNySiFvR8UKE39h3B/+LqqyIpj0K/lQiXCs+StaPeuLWz0Wjh33BP aGKNmxa5PVNe+bnedUAFqt4UzFKc3cLfBKDJxB8mBQXt3wiv5D1BiF8ijVFUmboqRHZJ luiCjstk+9JfIItZBeM08Uv1ZaJ0+dCeXSb97Q9BegNLPM/A1xJo+SHKWZBG1h2xZSzS cVMvLMwz+vaTDlwjfHEVVZcWQoDkmL2KpPqgWhNVmuqc9LCBKRO41/aCN4p9SVsHI60c Bw5F4kzJI6/EufaGr93iWbHMKkeczBhPxaXHoDbFYVlFT40eZwl0qzioi2C9dNE3cp7L epKw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fk24-20020a056402399800b0046cd7eb4327si31478115edb.376.2023.01.17.01.19.24; Tue, 17 Jan 2023 01:19:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236512AbjAQJPp (ORCPT + 99 others); Tue, 17 Jan 2023 04:15:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236464AbjAQJPR (ORCPT ); Tue, 17 Jan 2023 04:15:17 -0500 Received: from mxct.zte.com.cn (mxct.zte.com.cn [183.62.165.209]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A84AB32516 for ; Tue, 17 Jan 2023 01:07:01 -0800 (PST) Received: from mse-fl1.zte.com.cn (unknown [10.5.228.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxct.zte.com.cn (FangMail) with ESMTPS id 4Nx30q2PFbz501St; Tue, 17 Jan 2023 17:06:35 +0800 (CST) Received: from xaxapp02.zte.com.cn ([10.88.97.241]) by mse-fl1.zte.com.cn with SMTP id 30H96Rre076903; Tue, 17 Jan 2023 17:06:27 +0800 (+08) (envelope-from ye.xingchen@zte.com.cn) Received: from mapi (xaxapp01[null]) by mapi (Zmail) with MAPI id mid31; Tue, 17 Jan 2023 17:06:30 +0800 (CST) Date: Tue, 17 Jan 2023 17:06:30 +0800 (CST) X-Zmail-TransId: 2af963c66516fffffffffd6dec0a X-Mailer: Zmail v1.0 Message-ID: <202301171706300144532@zte.com.cn> Mime-Version: 1.0 From: To: Cc: , , , , Subject: =?utf-8?q?=5BPATCH_linux-next=5D_powerpc/cell/axon=5Fmsi=3A_Use_dma?= =?utf-8?q?=5Fzalloc=5Fcoherent=28=29?= X-MAIL: mse-fl1.zte.com.cn 30H96Rre076903 X-Fangmail-Gw-Spam-Type: 0 X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 63C6651B.003/4Nx30q2PFbz501St X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, T_SPF_PERMERROR,UNPARSEABLE_RELAY autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755260847281906877?= X-GMAIL-MSGID: =?utf-8?q?1755260847281906877?= From: ye xingchen Instead of using dma_alloc_coherent() and memset() directly use dma_zalloc_coherent(). Signed-off-by: ye xingchen --- arch/powerpc/platforms/cell/axon_msi.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/platforms/cell/axon_msi.c b/arch/powerpc/platforms/cell/axon_msi.c index 0c11aad896c7..8a4c522c8e67 100644 --- a/arch/powerpc/platforms/cell/axon_msi.c +++ b/arch/powerpc/platforms/cell/axon_msi.c @@ -358,8 +358,8 @@ static int axon_msi_probe(struct platform_device *device) goto out_free_msic; } - msic->fifo_virt = dma_alloc_coherent(&device->dev, MSIC_FIFO_SIZE_BYTES, - &msic->fifo_phys, GFP_KERNEL); + msic->fifo_virt = dma_zalloc_coherent(&device->dev, MSIC_FIFO_SIZE_BYTES, + &msic->fifo_phys, GFP_KERNEL); if (!msic->fifo_virt) { printk(KERN_ERR "axon_msi: couldn't allocate fifo for %pOF\n", dn); @@ -372,7 +372,6 @@ static int axon_msi_probe(struct platform_device *device) dn); goto out_free_fifo; } - memset(msic->fifo_virt, 0xff, MSIC_FIFO_SIZE_BYTES); /* We rely on being able to stash a virq in a u16, so limit irqs to < 65536 */ msic->irq_domain = irq_domain_add_nomap(dn, 65536, &msic_host_ops, msic);