Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp938483pxb; Wed, 6 Apr 2022 04:51:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwd3H44AiZLUjHktleoat5EMYSk367K0pk7E6NhS0cl8oNeMNsI8Q+1tZ8XZAqQnNEWZkZm X-Received: by 2002:a62:7b43:0:b0:4fa:6936:6986 with SMTP id w64-20020a627b43000000b004fa69366986mr8297411pfc.13.1649245900279; Wed, 06 Apr 2022 04:51:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649245900; cv=none; d=google.com; s=arc-20160816; b=KuSvncRszi6hxm//8QFanRnyyYJWVp8Sac4QA6mxiPmwTbNbEc5qb4cro35Au7pO1X 8aYoAtUPaTLmnBwaGqfjpH6KAS52IKHMJ0CE4W9cvNdZA+eMUpK2NrIo5tuu/y/uYmXz GV6ufcssikDSMVa6DjB3akDM2ryxO7b998lgBw85HlPEFttVsURqpH1/G3pbCw/wZkNK XHx1IpZ8noQ2M2k3BoCosl/4TniEGdQgc2wUcXTHngDCUW+4G0EdDzSvrzA05Wj0KCkP AlKQfp4nX+X00BpltcZ8tc4bxAXACqfz+V0yyUJJdN8LMLxz0AzKJZ9s4A8S5PNisVkJ agRQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=HH6UuCN7VQCdQtrbcTQ55xC8wwoBz2BxHZn2hSHWFzY=; b=Ka3QsK2IhzGw4Q6amlvCReDw5CSMDo8CJxSpZSVMwefGMV64vNs9Hcw2L23VorEua/ r2F76K4ElfEhRiAc19hGT2PnQKEP++9zm+Kc/t1H2QZkJJdknFG4f16c2o0E3GxBKnq1 3iyNpxYU2UNiArIotZ/XGcwGVeMIRUJXiU2rKDS0Ioc7+PFuUJCs+za/lcm2PwpocF1E xVY2ccrCZyz+YzON5ASrIwnpdNa4v0WjK99gCyOY3iR346fSoT+OTrqVG+DAxFjYGYWK lvu3xH6R2I8jYaITT2d/H2xL2dtjq9qZ4uufQ9Ovi6M4i7Z/3KM8U3mjg4a4UFzwoaiH e40Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZzyxVV1W; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id q13-20020a170902788d00b00153b2d16518si14759015pll.288.2022.04.06.04.51.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 04:51:40 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZzyxVV1W; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D081D639D9F; Wed, 6 Apr 2022 03:11:39 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1843963AbiDFBmh (ORCPT + 99 others); Tue, 5 Apr 2022 21:42:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349458AbiDEJtx (ORCPT ); Tue, 5 Apr 2022 05:49:53 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3913A2642; Tue, 5 Apr 2022 02:46:34 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id DF820B817D3; Tue, 5 Apr 2022 09:46:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 58EB4C385A2; Tue, 5 Apr 2022 09:46:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649151991; bh=585hVg3CEE7N+BxEqBeKlvcBfupAkqQVG7K/pktiGe0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZzyxVV1WuXp/rZWc4VZv6L1dmnrjJ9KmWWCHlXji0ZZ1jWv4/rK+ZK2/LRbCJzFCr 6G15WtSfj9UD0j4EoZZ1xR5urBP6M7dCQBjWriILlZ0NHfmsbHRRiI4u/S4K0tMVKM jX5wXPJU7nytA0qfGjJvMa8Z7tDAs/oVSX6AMa2Y= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jie Hai , Zhou Wang , Vinod Koul , Sasha Levin Subject: [PATCH 5.15 614/913] dmaengine: hisi_dma: fix MSI allocate fail when reload hisi_dma Date: Tue, 5 Apr 2022 09:27:56 +0200 Message-Id: <20220405070358.246404084@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 From: Jie Hai [ Upstream commit b95044b38425f563404234d96bbb20cc6360c7e1 ] 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 Acked-by: Zhou Wang Link: https://lore.kernel.org/r/20220216072101.34473-1-haijie1@huawei.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- 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 c855a0e4f9ff..f680e9b40bf7 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.34.1