Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp3816636pxb; Mon, 21 Feb 2022 06:19:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJx21mSdtI5HFtF3JrbHXh9G/x0vjczEZzPB9pN3NcDIfQUnDbbbnnUHR2NLLUbG+HIVm5IQ X-Received: by 2002:a17:902:e8d7:b0:149:3b5d:2b8b with SMTP id v23-20020a170902e8d700b001493b5d2b8bmr18599858plg.162.1645453188352; Mon, 21 Feb 2022 06:19:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645453188; cv=none; d=google.com; s=arc-20160816; b=Gx84r7x9SW3MsEije+V2xUhRMx+xt7efWKTlcLM1aMb/TRLJ1ul6rR1nmEm+rekXeD czfvToz5YTsqfNICYyaLOjjtywFYgqkir8gahcJkMEmGj3x4PAtqAx066ML3eOt4eTm2 bJC07iVqZj7v4QAXO/HMS60X0DbfHXhrwzVC6Ov0TlFv90zAHCpKVfyYq7FJBePPWdFR SQ1T6S34zZMplkSbFaX2KSiQfB+7CwknjyKtXsuELODL1neMOVotzAuFb3CEBokHf3iu FFAg4XyUWuUQW+v+AD86BqVj2fPQgo/8gg/CK7BoDh/66L/0j5rcawYL0dL3aJJgMNOm 0DTw== 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:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=9Lvkdrfwn4Se5WxxxQS9bol5uM0W7Ns0n6IHIzV9UPU=; b=sD33VtVubQmvsd+Mn7qxFqewqUNx77P0r3P3J+LurlpLviLMQzEp0OPfSWbPwVsuQb tzZ111RwP/i3eow3a5GxfT9nKZYNwrcsn9fGL10PAcyK1mYLBhQ0q7Vm+XZBMAsA4Tm8 Y1BGmsqctTe8pT8AR78hdKePbTTx7I3fh7UbDOAxXXHjf/jU3FrUQIRhxene/Vyz9gDf Wgq2c5zmwn0oqmnuVEZ6y2NYUM42hPqxxIg1dGg7lY1EGZ8Oin3xYwFFcxp5TWTtYCqu uo5kIdY2Csj1Khl2dimtYzQgd8oneSzFi/zwLBPFjb8HvsZd9V1V3rWX+/jKfDFFdAw+ 8vwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=wXf6gsuL; 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 w15si2927284pgi.77.2022.02.21.06.19.33; Mon, 21 Feb 2022 06:19:48 -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=wXf6gsuL; 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 S1355409AbiBUKxs (ORCPT + 72 others); Mon, 21 Feb 2022 05:53:48 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:49522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349849AbiBUKx2 (ORCPT ); Mon, 21 Feb 2022 05:53:28 -0500 Received: from alexa-out-sd-02.qualcomm.com (alexa-out-sd-02.qualcomm.com [199.106.114.39]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0267A11A07; Mon, 21 Feb 2022 02:19:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1645438781; x=1676974781; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=9Lvkdrfwn4Se5WxxxQS9bol5uM0W7Ns0n6IHIzV9UPU=; b=wXf6gsuLsiOJeP1egHcN8aaoaDXLkEjtArzBazna+Nvp5F5y7loH/gWt SLNAAq+NAVsQDlrt+/KFqZwc8NgEAfkb3ekb8OLT+3VPt/nHOHIB/3/tq 4iX6sEAGedzPe4u4J8SjCWJg1lnqTVYVJn0OzlJYF7TGx53aDTKxm1t85 A=; Received: from unknown (HELO ironmsg02-sd.qualcomm.com) ([10.53.140.142]) by alexa-out-sd-02.qualcomm.com with ESMTP; 21 Feb 2022 02:19:41 -0800 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg02-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Feb 2022 02:19:41 -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, 21 Feb 2022 02:19:40 -0800 Received: from [10.216.7.34] (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, 21 Feb 2022 02:19:38 -0800 Message-ID: Date: Mon, 21 Feb 2022 15:49:19 +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 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> <87h79of470.fsf@kernel.org> <9acca69c-3d5d-b6b9-b5ca-c2411e206908@quicinc.com> <871qzwzidr.fsf@kernel.org> From: Manikanta Pubbisetty In-Reply-To: <871qzwzidr.fsf@kernel.org> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) 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/21/2022 2:49 PM, Kalle Valo wrote: > Manikanta Pubbisetty writes: > >> On 1/28/2022 5:43 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 >>> >>> [...] >>> >>>> --- /dev/null >>>> +++ b/drivers/net/wireless/ath/ath11k/pci_cmn.c >>> >>> [...] >>> >>>> +static inline void ath11k_pci_select_window(struct ath11k_pci *ab_pci, u32 offset) >>>> +{ >>>> + struct ath11k_base *ab = ab_pci->ab; >>>> + >>>> + u32 window = FIELD_GET(ATH11K_PCI_WINDOW_VALUE_MASK, offset); >>>> + >>>> + lockdep_assert_held(&ab_pci->window_lock); >>>> + >>>> + if (window != ab_pci->register_window) { >>>> + iowrite32(ATH11K_PCI_WINDOW_ENABLE_BIT | window, >>>> + ab->mem + ATH11K_PCI_WINDOW_REG_ADDRESS); >>>> + ioread32(ab->mem + ATH11K_PCI_WINDOW_REG_ADDRESS); >>>> + ab_pci->register_window = window; >>>> + } >>>> +} >>> >>> So the style used in ath11k is ath11k__foo, so that a function >>> ath11k_pci_foo() should be in pci.c. This patch is now breaking that >>> style. Maybe pci_cmn.c should renamed to cpci.c, pcic.c or something >>> like that? Then the function prefix could be ath11k_cpci_, ath11k_pcic_ >>> or similar. >>> >> >> Makes sense, pcic.c and ath11k_pcic_* looks better, I'll make these changes. > > Of course another possiblity, which I forgot to mention in my previous > email, is to keep pci_cmn.c filename but rename the functions to > ath11k_pci_cmn_foo(). Though don't know which one is better. > I was contemplating on having ath11k_pci_cmn_* for a very long time; In fact, in the patches which I worked on had the pci_cmn prefix for all the APIs, I felt the prefix is long and dropped the idea :) At least to me, pcic.c and ath11k_pcic* looked good.