Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp615306pxb; Tue, 15 Feb 2022 23:54:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJyp88D9RT9VwKyTuSDP1TJj+uv3aLgJJEUI7Kc2hLwFgxYcYFNn17J4eggWtkyZbeT3HVjC X-Received: by 2002:a17:903:230e:b0:14d:a8c5:90c2 with SMTP id d14-20020a170903230e00b0014da8c590c2mr1245818plh.5.1644998042612; Tue, 15 Feb 2022 23:54:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644998042; cv=none; d=google.com; s=arc-20160816; b=Uv0bHUakoyjy2q8UIJUd9MIzoy0Kr7QSmBJh6TFcjg6b1Pt7Jf4SmRX/H8y/Qke4di AF66Xp+mD9ilLNXkTWsQ4qUuZibMn4TrlGrGhSEps8KLDr34PbtJK3pSJ1M1+wb0Tv3o v7gbN8ZcgRSGkHfmjCI+HJpoIpBQoL0+VU/zN1HGfjeggDMn9IZkYQErt88pkkdb+MY4 6XJEgn+XBoAqnt5Mi/I3nDPUXib/xMh0XO1y1amAnO8k0/853aquOi2k1HTpVGkbGuQK U8K4tEg1WdJZIxikeHzEXiyOHcnpCKuDrawEH9xwApxIldYKdlstkHKbFmFso9R2QUNC xMPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=BYlTKXIgx8XMNRkdlXJRsMgLlVuSRQfjVteKUUiws2M=; b=yo+XT1NofQGU+m98HYVSiJPlHgUirk8sF2Z0+MrmcC60Zr8idoyH8/+TzlwtCZxssk 4jDFJslZ4tMmtBw8z/Jl4hwtHMZI/c7+IZ0USnQtQeZJummNcsnqk5YirjL4UeJNwX7K PZU9v0cSKJM7xnxkSmDL0V2bBVWwuVDAeoAWHDKMliiMsK4TNgy7Ux4hwnWP1SrWnxQn r1Z7cvfEqE8E50NLrnaNaYyR0ru/BFf7Q66Kgfd8fiNAtct4cxjd5ISW6IGwTLNpLLiP PlCAVHGs9ERH7WafqasohbS5eiFBxsW6WQmFOVKO/8Eb8TdZk07Y2cMAKBNDFWLpSN8b yOLw== 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:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id n68si31171732pfd.135.2022.02.15.23.54.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Feb 2022 23:54:02 -0800 (PST) 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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2A1DA1DA4B; Tue, 15 Feb 2022 23:21:33 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229976AbiBPHV3 (ORCPT + 99 others); Wed, 16 Feb 2022 02:21:29 -0500 Received: from gmail-smtp-in.l.google.com ([23.128.96.19]:58248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229947AbiBPHV0 (ORCPT ); Wed, 16 Feb 2022 02:21:26 -0500 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BEC8A205F3; Tue, 15 Feb 2022 23:21:11 -0800 (PST) Received: from kwepemi100005.china.huawei.com (unknown [172.30.72.54]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4Jz8Ry439Fz8wk6; Wed, 16 Feb 2022 15:17:50 +0800 (CST) Received: from kwepemm600007.china.huawei.com (7.193.23.208) by kwepemi100005.china.huawei.com (7.221.188.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Wed, 16 Feb 2022 15:21:09 +0800 Received: from localhost.localdomain (10.69.192.56) by kwepemm600007.china.huawei.com (7.193.23.208) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Wed, 16 Feb 2022 15:21:09 +0800 From: Jie Hai To: , CC: , Subject: [PATCH] dmaengine: hisi_dma: fix MSI allocate fail when reload hisi_dma Date: Wed, 16 Feb 2022 15:21:01 +0800 Message-ID: <20220216072101.34473-1-haijie1@huawei.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.69.192.56] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemm600007.china.huawei.com (7.193.23.208) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, 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 Remove the loaded hisi_dma driver and reload it, the driver fails to work properly. The following error is reported in the kernel log: [ 1475.597609] hisi_dma 0000:7b:00.0: Failed to allocate MSI vectors! [ 1475.604915] hisi_dma: probe of 0000:7b:00.0 failed with error -28 As noted in "The MSI Driver Guide HOWTO"[1], the number of MSI interrupt must be a power of two. The Kunpeng DMA driver allocates 30 MSI interrupts. As a result, no space left on device is reported when the driver is reloaded and allocates interrupt vectors from the interrupt domain. This patch changes the number of interrupt vectors allocated by hisi_dma driver to 32 to avoid this problem. [1] https://www.kernel.org/doc/html/latest/PCI/msi-howto.html Fixes: e9f08b65250d ("dmaengine: hisilicon: Add Kunpeng DMA engine support") Signed-off-by: Jie Hai --- drivers/dma/hisi_dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma/hisi_dma.c b/drivers/dma/hisi_dma.c index 97c87a7cba87..43817ced3a3e 100644 --- a/drivers/dma/hisi_dma.c +++ b/drivers/dma/hisi_dma.c @@ -30,7 +30,7 @@ #define HISI_DMA_MODE 0x217c #define HISI_DMA_OFFSET 0x100 -#define HISI_DMA_MSI_NUM 30 +#define HISI_DMA_MSI_NUM 32 #define HISI_DMA_CHAN_NUM 30 #define HISI_DMA_Q_DEPTH_VAL 1024 -- 2.33.0