[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHNKnsStshsku4FyHaYGJm=HWXpJH1J6S5Zras4te0NgHr1oDw@mail.gmail.com>
Date: Mon, 7 Mar 2022 05:44:12 +0300
From: Sergey Ryazanov <ryazanov.s.a@...il.com>
To: Ricardo Martinez <ricardo.martinez@...ux.intel.com>
Cc: netdev@...r.kernel.org, linux-wireless@...r.kernel.org,
Jakub Kicinski <kuba@...nel.org>,
David Miller <davem@...emloft.net>,
Johannes Berg <johannes@...solutions.net>,
Loic Poulain <loic.poulain@...aro.org>,
M Chetan Kumar <m.chetan.kumar@...el.com>,
chandrashekar.devegowda@...el.com,
Intel Corporation <linuxwwan@...el.com>,
chiranjeevi.rapolu@...ux.intel.com,
Haijun Liu (刘海军)
<haijun.liu@...iatek.com>, amir.hanania@...el.com,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
dinesh.sharma@...el.com, eliot.lee@...el.com,
ilpo.johannes.jarvinen@...el.com, moises.veleta@...el.com,
pierre-louis.bossart@...el.com, muralidharan.sethuraman@...el.com,
Soumya.Prakash.Mishra@...el.com, sreehari.kancharla@...el.com,
madhusmita.sahu@...el.com
Subject: Re: [PATCH net-next v5 03/13] net: wwan: t7xx: Add core components
On Thu, Feb 24, 2022 at 1:35 AM Ricardo Martinez
<ricardo.martinez@...ux.intel.com> wrote:
> From: Haijun Liu <haijun.liu@...iatek.com>
>
> Registers the t7xx device driver with the kernel. Setup all the core
> components: PCIe layer, Modem Host Cross Core Interface (MHCCIF),
> modem control operations, modem state machine, and build
> infrastructure.
>
> * PCIe layer code implements driver probe and removal.
> * MHCCIF provides interrupt channels to communicate events
> such as handshake, PM and port enumeration.
> * Modem control implements the entry point for modem init,
> reset and exit.
> * The modem status monitor is a state machine used by modem control
> to complete initialization and stop. It is used also to propagate
> exception events reported by other components.
[skipped]
> +static struct t7xx_modem *t7xx_md_alloc(struct t7xx_pci_dev *t7xx_dev)
> +{
> + struct device *dev = &t7xx_dev->pdev->dev;
> + struct t7xx_modem *md;
> +
> + md = devm_kzalloc(dev, sizeof(*md), GFP_KERNEL);
> + if (!md)
> + return NULL;
> +
> + md->t7xx_dev = t7xx_dev;
> + t7xx_dev->md = md;
> + md->core_md.ready = false;
> + spin_lock_init(&md->exp_lock);
> + md->handshake_wq = alloc_workqueue("%s", WQ_UNBOUND | WQ_MEM_RECLAIM | WQ_HIGHPRI,
> + 0, "md_hk_wq");
> + if (!md->handshake_wq)
> + return NULL;
> +
> + INIT_WORK(&md->handshake_work, t7xx_md_hk_wq);
> + return md;
> +}
> +
> +int t7xx_md_reset(struct t7xx_pci_dev *t7xx_dev)
> +{
> + struct t7xx_modem *md = t7xx_dev->md;
> +
> + md->md_init_finish = false;
> + md->exp_id = 0;
> + spin_lock_init(&md->exp_lock);
Looks like a duplicated initialization, the first time the lock was
initialized in the t7xx_md_alloc() above.
> + t7xx_fsm_reset(md);
> + t7xx_cldma_reset(md->md_ctrl[CLDMA_ID_MD]);
> + md->md_init_finish = true;
> + return 0;
> +}
[skipped]
> +void t7xx_pcie_set_mac_msix_cfg(struct t7xx_pci_dev *t7xx_dev, unsigned int irq_count)
> +{
> + u32 val;
> +
> + val = ffs(irq_count) * 2 - 1;
Move this initialization to the variable declaration.
> + iowrite32(val, IREG_BASE(t7xx_dev) + T7XX_PCIE_CFG_MSIX);
> +}
--
Sergey
Powered by blists - more mailing lists