Return-path: Received: from wolverine01.qualcomm.com ([199.106.114.254]:56206 "EHLO wolverine01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751083Ab1GZHbH (ORCPT ); Tue, 26 Jul 2011 03:31:07 -0400 Date: Tue, 26 Jul 2011 13:01:15 +0530 From: Rajkumar Manoharan To: Stanislaw Gruszka CC: linux-wireless , , , Jonathan Nieder , Tony Houghton , Adrian Chadd Subject: Re: [RFC/RFT 6/6] ath9k: always initialize hw registers related to PCIe PM Message-ID: <20110726073113.GA3335@vmraj-lnx.users.atheros.com> (sfid-20110726_093112_622638_F308D069) References: <1311341512-2882-1-git-send-email-sgruszka@redhat.com> <1311341512-2882-7-git-send-email-sgruszka@redhat.com> <20110723051129.GC828@vmraj-lnx.users.atheros.com> <20110725092929.GB2608@redhat.com> <20110725140152.GD2608@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" In-Reply-To: <20110725140152.GD2608@redhat.com> Sender: linux-wireless-owner@vger.kernel.org List-ID: On Mon, Jul 25, 2011 at 04:01:52PM +0200, Stanislaw Gruszka wrote: > On Mon, Jul 25, 2011 at 11:29:30AM +0200, Stanislaw Gruszka wrote: > > On Sat, Jul 23, 2011 at 10:41:30AM +0530, Rajkumar Manoharan wrote: > > > > + /* initalize PCIe PM registers if device introduce itself as PCIe */ > > > > + if (ah->is_pciexpress) > > > > + ath9k_hw_ops(ah)->config_pci_powersave(ah, false); > > > > + > > > Use ath9k_hw_configpcipowersave wrapper instead. > > I changed wrapper to check ah->aspm_enabled, so if I would use it here > > it will not setup registers. I think I should comment that. > > Yeah. I got it. I think ah->aspm_enabled alone is sufficient in the wrapper function. > > > And ensure that there is no > > > sideeffect by changing SERDES config from __ath9k_hw_init to pci_probe. > > Hmm, not sure if I understand what I have to do :-( > > > > We have something like that: > > > > ath_pci_probe > > ath9k_init_device > > ath9k_init_softc > > ath9k_hw_init > > __ath9k_hw_init > > ath9k_hw_configpcipowersave(); > > > > I changed it this way: > > > > ath_pci_probe > > ath9k_init_device > > ath9k_init_softc > > ath9k_hw_init > > __ath9k_hw_init > > > > ath9k_init_queues > > ath9k_init_btcoex > > some other inits > > > > ath9k_hw_configpcipowersave(); > > > > Can this cause some side effects? > > Actually this movement is not necessary, in the way things I did > currently. Is enough to replace ath9k_hw_configpcipowersave() by > ath9k_hw_ops(ah)->config_pci_powersave() in __ath9k_hw_init(). > In such case SERDES and PCIe PM registers will be always initialized. > > However movement would be needed if we want to initialize registers, > only when ASPM is enabled, hence we first need to discovery that, > and then eventually call ath9k_hw_configpcipowersave(). > > Which option is correct: always initialize SERDES and PCIe PM registers > or do it only if ASPM is enabled? > Good point. Let them configured on ASPM case. please cross check with other embed platform. -- Rajkumar