Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3124569pxp; Tue, 8 Mar 2022 08:09:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJz2RGoQ8kOuIS2Dwj5FdMWzvuoFtKikBMFuPgnb/0gQPhZS3NCUDMIlkp4JDDT8O7vScoBq X-Received: by 2002:a17:906:16cc:b0:6ce:e607:ff02 with SMTP id t12-20020a17090616cc00b006cee607ff02mr13487419ejd.418.1646755741865; Tue, 08 Mar 2022 08:09:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646755741; cv=none; d=google.com; s=arc-20160816; b=BzwEQCBnDGBh2e9xSuu6LGctzJEpypYIBacAP4PGRipiqnmIhPe60ezXGXJLMaRL+j woD/T3Uf0X2v5K/Jj3fxtfJE86Ft0DxUo5UW9uaMz7f2Fbz2BaLauJpPRGUN16dE7yJz hAxjLEI7Ziggo2npYgw+/Qs/V58ZJ1u5rgTHFWtEbFt9jftiWJ5gpHD+BQNrfiF186wo IyJSFHqBDGTprKd1Oo84gCB6fluH6Nh6q1vt6KBFS5TFAlKF2xlmucYfYGX/HPRXo/2F JcrhQzT9i/MwkHvX1gKW5938ub8Q3craeASmJ1ly8w9r6BwzPOD1qP7EL7pQPIrCCfqo KCuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:references :cc:to:from:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=1XOqnXLpeVJlC4KyK0YuUmJ4jg+OeQyDZQ+E0RW+bRE=; b=03Uv+XS1tItg+iLIpMtp+IW7Dpc7wcXatfWoKqZFOFEIZ7qZvblL9aUIWaxBhuCFFc G4xehTSdRURklYwlNf26YVsmOEx0UkCxWecrxJ8x32XwjQGgCeJak6LrcIk8Lw3Rv2TC SRcTp8mY4b6mnRZfAPP6c5juRk107r4F6/qcA0tQragzonje1VDJPaOrN0YgiWCJVbAH TjHvYpPvMZWlWnFO6IYjkSI225CP4r4QMXcYFMoD9U9IT+82tQwlX42uy25/8qtIwz9N vMCk+2hi5Ttvx3mUVHZhxokEYP9nagrjj3APYrtCDhfdZuZupOI8TJy/gAcjnfOFTsf7 oaQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b="UPBfvD/L"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jg32-20020a170907972000b006da955bd303si10905978ejc.860.2022.03.08.08.08.43; Tue, 08 Mar 2022 08:09:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-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; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b="UPBfvD/L"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344131AbiCHGQB (ORCPT + 70 others); Tue, 8 Mar 2022 01:16:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233516AbiCHGQA (ORCPT ); Tue, 8 Mar 2022 01:16:00 -0500 Received: from alexa-out-sd-01.qualcomm.com (alexa-out-sd-01.qualcomm.com [199.106.114.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E921829837; Mon, 7 Mar 2022 22:15:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1646720105; x=1678256105; h=message-id:date:mime-version:subject:from:to:cc: references:in-reply-to:content-transfer-encoding; bh=1XOqnXLpeVJlC4KyK0YuUmJ4jg+OeQyDZQ+E0RW+bRE=; b=UPBfvD/LRXpOymuspj6M0c+Ty8CJtlwurqbbaC2qaNy4Oa9/27Ex6OES yTwkMkdBXqlGC3cqEcKhqPR4xqOpSJggDmKYvUJBggt8JGvUV8cPq62BO 4/YyaHvNbg95eGfXDX1oZsgDU4r+XoiM4FEHR1sXderav5wpFm2MS8cc2 U=; Received: from unknown (HELO ironmsg05-sd.qualcomm.com) ([10.53.140.145]) by alexa-out-sd-01.qualcomm.com with ESMTP; 07 Mar 2022 22:01:02 -0800 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg05-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Mar 2022 22:01:01 -0800 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.15; Mon, 7 Mar 2022 22:01:01 -0800 Received: from [10.216.19.10] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.15; Mon, 7 Mar 2022 22:00:56 -0800 Message-ID: Date: Tue, 8 Mar 2022 11:30:51 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCH v2 02/19] ath11k: Refactor PCI code to support hybrid bus devices Content-Language: en-US From: Manikanta Pubbisetty To: Kalle Valo CC: , , , References: <1642337235-8618-1-git-send-email-quic_mpubbise@quicinc.com> <1642337235-8618-3-git-send-email-quic_mpubbise@quicinc.com> <87ee4sgo7l.fsf@kernel.org> <41f8fd92-70e4-def6-0bd1-c764b1445d68@quicinc.com> In-Reply-To: <41f8fd92-70e4-def6-0bd1-c764b1445d68@quicinc.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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-wireless@vger.kernel.org On 2/25/2022 11:20 AM, Manikanta Pubbisetty wrote: > On 1/28/2022 3:46 PM, Kalle Valo wrote: >> Manikanta Pubbisetty writes: >> >>> Unlike other ATH11K PCIe devices which are enumerated by APSS >>> processor (Application Processor SubSystem), WCN6750 gets >>> enumerated by the WPSS Q6 processor (Wireless Processor SubSystem); >>> In simple terms, though WCN6750 is PCIe device, it is not attached >>> to the APSS processor, APSS will not know of such a device being >>> present in the system and therefore WCN6750 will be registered as >>> a platform device to the kernel core like other supported AHB >>> devices. >>> >>> WCN6750 uses both AHB and PCI APIs for it's operation, it uses >>> AHB APIs for device probe/boot and PCI APIs for device setup >>> and register accesses; Because of this nature, it is referred >>> as a hybrid bus device. >>> >>> Refactor PCI code to support hybrid bus devices like WCN6750. >>> >>> Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00573-QCAMSLSWPLZ-1 >>> Tested-on: WCN6855 hw2.0 PCI >>> WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 >>> Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1 >>> Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00192-QCAHKSWPL_SILICONZ-1 >>> >>> Signed-off-by: Manikanta Pubbisetty >> >> [...] >> >>> --- a/drivers/net/wireless/ath/ath11k/Makefile >>> +++ b/drivers/net/wireless/ath/ath11k/Makefile >>> @@ -29,7 +29,7 @@ obj-$(CONFIG_ATH11K_AHB) += ath11k_ahb.o >>>   ath11k_ahb-y += ahb.o >>>   obj-$(CONFIG_ATH11K_PCI) += ath11k_pci.o >>> -ath11k_pci-y += mhi.o pci.o >>> +ath11k_pci-y += mhi.o pci.o pci_cmn.o >> >> So the end result looks like this: >> >> obj-$(CONFIG_ATH11K_AHB) += ath11k_ahb.o >> ath11k_ahb-y += ahb.o pci_cmn.o >> >> obj-$(CONFIG_ATH11K_PCI) += ath11k_pci.o >> ath11k_pci-y += mhi.o pci.o pci_cmn.o >> >> Linking pci_cmn.o to both ath11k_pci.ko and ath11k_ahb.ko looks wrong. >> Does that even compile if ath11k is linked to the kernel, eg. with >> allyesconfig? >> > > I did try compiling the kernel with allyesconfig after your comment, > compilation went through without any hiccups. > >> One way to solve is to link pci_cmn.o to ath11k.ko. But for another >> approach, for a long time I have been thinking about what's the point to >> have separate ath11k_pci.ko and ath11k_ahb.ko modules?,They are very >> small anyway compared to ath11k.ko. So my ideais that should we have >> just one ath11k.ko module, it contains all AHB and PCI code as well, and >> ath11k_pci.ko and ath11k_ahb.ko would not be created anymore. It would >> simplify things a bit, especially here. >> >> Thoughts? >> > > I see some concerns going with single module combining both AHB and PCI > modules into ath11k.ko > > 1) AHB and PCI drivers make use of completely different kernel > frameworks, for example AHB driver needs remoteproc APIs for booting and > require CONFIG_REMOTEPROC to be compiled in to the kernel. Similarly, > PCI driver needs MHI APIs and also dependent on CONFIG_PCI. Both MHI and > PCI bus frameworks need to be compiled for PCI to work. If we club all > of this into single module, I see that unnecessarily additional modules > will be compiled into the kernel which IMO is not so good idea. > > > 2) Secondly, there is high chance of writing bad code all over the > driver. For example, there are chances that developers put AHB/PCI > specific code all over the driver creating a big mess. > Though this can be avoided with stringent code review, but why to > give the chance. > > Though AHB and PCI drivers are smaller in size, IMHO let AHB and PCI be > independent drivers, code looks cleaner and properly segregated by > keeping them as it is today. > > Regarding the compilation of PCI common code, shall we move it into > ath11k.ko? What is your opinion on this. > Hi Kalle, Any thoughts about the idea proposed? Thanks, Manikanta