From: "Yanchao Yang (杨彦超)" <Yanchao.Yang@mediatek.com>
To: "kuba@kernel.org" <kuba@kernel.org>
Cc: "Chris Feng (冯保林)" <Chris.Feng@mediatek.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-mediatek@lists.infradead.org"
<linux-mediatek@lists.infradead.org>,
"Mingliang Xu (徐明亮)" <mingliang.xu@mediatek.com>,
"Min Dong (董敏)" <min.dong@mediatek.com>,
"linuxwwan@intel.com" <linuxwwan@intel.com>,
"m.chetan.kumar@intel.com" <m.chetan.kumar@intel.com>,
"Liang Lu (吕亮)" <liang.lu@mediatek.com>,
"Haijun Liu (刘海军)" <haijun.liu@mediatek.com>,
"Haozhe Chang (常浩哲)" <Haozhe.Chang@mediatek.com>,
"Hua Yang (杨华)" <Hua.Yang@mediatek.com>,
"ryazanov.s.a@gmail.com" <ryazanov.s.a@gmail.com>,
"Xiayu Zhang (张夏宇)" <Xiayu.Zhang@mediatek.com>,
"loic.poulain@linaro.org" <loic.poulain@linaro.org>,
"pabeni@redhat.com" <pabeni@redhat.com>,
"edumazet@google.com" <edumazet@google.com>,
"Ting Wang (王挺)" <ting.wang@mediatek.com>,
"johannes@sipsolutions.net" <johannes@sipsolutions.net>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"Aiden Wang (王咏麒)" <Aiden.Wang@mediatek.com>,
"Felix Chen (陈非)" <Felix.Chen@mediatek.com>,
"Lambert Wang (王伟)" <Lambert.Wang@mediatek.com>,
"davem@davemloft.net" <davem@davemloft.net>,
"Mingchuang Qiao (乔明闯)" <Mingchuang.Qiao@mediatek.com>,
"Guohao Zhang (张国豪)" <Guohao.Zhang@mediatek.com>
Subject: Re: [PATCH net-next v3 01/10] net: wwan: tmi: Add PCIe core
Date: Fri, 24 Feb 2023 07:39:33 +0000 [thread overview]
Message-ID: <d6f13d66a5ab0224f2ae424a0645d4cf29c2752b.camel@mediatek.com> (raw)
In-Reply-To: <2e518c17bf54298a2108de75fcd35aaf2b3397d3.camel@mediatek.com>
Hi Jakub,
On Thu, 2023-02-16 at 20:50 +0800, Yanchao Yang wrote:
> >
> Hi Jakub,
>
> On Tue, 2023-02-14 at 20:22 -0800, Jakub Kicinski wrote:
> > On Sat, 11 Feb 2023 16:37:23 +0800 Yanchao Yang wrote:
> > > +ccflags-y += -I$(srctree)/$(src)/
> > > +ccflags-y += -I$(srctree)/$(src)/pcie/
> >
> > Do you really need these flags?
>
> We will check and update if it's really redundant soon.
Update test result.
Both flags are deleted, then run the make command with
"build in" and "build module" on a separate kernel tree. Both suffer
the same build error.
“drivers/net/wan/mediatek/pcie/mtk_pci.c:16:10: fatal error: mtk_fsm.h:
No such file or directory
#include "mtk_fsm.h""
The reason is that all files are not placed in the same folder. The
driver named TMI needs a child folder, then needs these flags.
Any ideas or comments for this? Please help share it at your
convenience.
> > > +{
> > > + struct pci_dev *pdev = to_pci_dev(mdev->dev);
> > > + int irq_cnt;
> > > +
> > > + irq_cnt = pci_alloc_irq_vectors(pdev, MTK_IRQ_CNT_MIN,
> > > max_irq_cnt, irq_type);
> > > + mdev->msi_nvecs = irq_cnt;
> > > +
> > > + if (irq_cnt < MTK_IRQ_CNT_MIN) {
> > > + dev_err(mdev->dev,
> > > + "Unable to alloc pci irq vectors. ret=%d
> > > maxirqcnt=%d irqtype=0x%x\n",
> > > + irq_cnt, max_irq_cnt, irq_type);
> > > + return -EFAULT;
> > > + }
> > > +
> > > + return mtk_pci_request_irq_msix(mdev, irq_cnt);
> > > +}
> > > +
> > > +static void mtk_pci_free_irq(struct mtk_md_dev *mdev)
> > > +{
> > > + struct pci_dev *pdev = to_pci_dev(mdev->dev);
> > > + struct mtk_pci_priv *priv = mdev->hw_priv;
> > > + int i;
> > > +
> > > + for (i = 0; i < priv->irq_cnt; i++)
> > > + pci_free_irq(pdev, i, &priv->irq_desc[i]);
> > > +
> > > + pci_free_irq_vectors(pdev);
> > > +}
> > > +
> > > +static void mtk_pci_save_state(struct mtk_md_dev *mdev)
> > > +{
> > > + struct pci_dev *pdev = to_pci_dev(mdev->dev);
> > > + struct mtk_pci_priv *priv = mdev->hw_priv;
> > > + int ltr, l1ss;
> > > +
> > > + pci_save_state(pdev);
> > > + /* save ltr */
> > > + ltr = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_LTR);
> > > + if (ltr) {
> > > + pci_read_config_word(pdev, ltr + PCI_LTR_MAX_SNOOP_LAT,
> > > + &priv->ltr_max_snoop_lat);
> > > + pci_read_config_word(pdev, ltr +
> > > PCI_LTR_MAX_NOSNOOP_LAT,
> > > + &priv->ltr_max_nosnoop_lat);
> > > + }
> > > + /* save l1ss */
> > > + l1ss = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_L1SS);
> > > + if (l1ss) {
> > > + pci_read_config_dword(pdev, l1ss + PCI_L1SS_CTL1,
> > > &priv->l1ss_ctl1);
> > > + pci_read_config_dword(pdev, l1ss + PCI_L1SS_CTL2,
> > > &priv->l1ss_ctl2);
> > > + }
> > > +}
> > > + dev_info(mdev->dev, "Probe done hw_ver=0x%x\n", mdev->hw_ver);
> > > + return 0;
> > > +
> > > +err_save_state:
> >
> > Labels should be named after action they perform, not where they
> > jump
> > from. Please fix this everywhere.
>
> We can found similar samples in kernel codes, naming the label per
> where jump from…
> ex. pci-sysfs.c
> shall we apply this rule to our driver?
> I
> t's mandatory or nice to have.
Any ideas or comments for this? Please help share it at your
convenience.
Many thanks.
yanchao.yang
next prev parent reply other threads:[~2023-02-24 7:55 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-11 8:37 [PATCH net-next v3 00/10] net: wwan: tmi: PCIe driver for MediaTek M.2 modem Yanchao Yang
2023-02-11 8:37 ` [PATCH net-next v3 01/10] net: wwan: tmi: Add PCIe core Yanchao Yang
2023-02-15 4:22 ` Jakub Kicinski
2023-02-16 12:50 ` Yanchao Yang (杨彦超)
2023-02-16 18:10 ` Jakub Kicinski
2023-02-24 7:39 ` Yanchao Yang (杨彦超) [this message]
2023-02-24 19:50 ` Jakub Kicinski
2023-02-27 12:11 ` Yanchao Yang (杨彦超)
2023-02-27 19:00 ` Jakub Kicinski
2023-02-28 7:47 ` Yanchao Yang (杨彦超)
2023-02-11 8:37 ` [PATCH net-next v3 02/10] net: wwan: tmi: Add control plane transaction layer Yanchao Yang
2023-02-11 8:37 ` [PATCH net-next v3 03/10] net: wwan: tmi: Add control DMA interface Yanchao Yang
2023-02-11 8:37 ` [PATCH net-next v3 04/10] net: wwan: tmi: Add control port Yanchao Yang
2023-02-11 8:37 ` [PATCH net-next v3 05/10] net: wwan: tmi: Add FSM thread Yanchao Yang
2023-02-11 8:37 ` [PATCH net-next v3 06/10] net: wwan: tmi: Add AT & MBIM WWAN ports Yanchao Yang
2023-02-11 8:37 ` [PATCH net-next v3 07/10] net: wwan: tmi: Introduce data plane hardware interface Yanchao Yang
2023-02-11 8:37 ` [PATCH net-next v3 08/10] net: wwan: tmi: Add data plane transaction layer Yanchao Yang
2023-02-11 8:37 ` [PATCH net-next v3 09/10] net: wwan: tmi: Introduce WWAN interface Yanchao Yang
2023-02-11 8:37 ` [PATCH net-next v3 10/10] net: wwan: tmi: Add maintainers and documentation Yanchao Yang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d6f13d66a5ab0224f2ae424a0645d4cf29c2752b.camel@mediatek.com \
--to=yanchao.yang@mediatek.com \
--cc=Aiden.Wang@mediatek.com \
--cc=Chris.Feng@mediatek.com \
--cc=Felix.Chen@mediatek.com \
--cc=Guohao.Zhang@mediatek.com \
--cc=Haozhe.Chang@mediatek.com \
--cc=Hua.Yang@mediatek.com \
--cc=Lambert.Wang@mediatek.com \
--cc=Mingchuang.Qiao@mediatek.com \
--cc=Xiayu.Zhang@mediatek.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=haijun.liu@mediatek.com \
--cc=johannes@sipsolutions.net \
--cc=kuba@kernel.org \
--cc=liang.lu@mediatek.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linuxwwan@intel.com \
--cc=loic.poulain@linaro.org \
--cc=m.chetan.kumar@intel.com \
--cc=min.dong@mediatek.com \
--cc=mingliang.xu@mediatek.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=ryazanov.s.a@gmail.com \
--cc=ting.wang@mediatek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).