From: Richard Cochran <richardcochran@gmail.com>
To: Xabier Marquiegui <reibax@gmail.com>
Cc: netdev@vger.kernel.org, horms@kernel.org,
chrony-dev@chrony.tuxfamily.org, mlichvar@redhat.com,
ntp-lists@mattcorallo.com, vinicius.gomes@intel.com,
alex.maftei@amd.com, davem@davemloft.net, rrameshbabu@nvidia.com,
shuah@kernel.org
Subject: Re: [PATCH net-next v3 1/3] ptp: Replace timestamp event queue with linked list
Date: Sat, 30 Sep 2023 14:44:11 -0700 [thread overview]
Message-ID: <ZRiWq+GVZ9OjchR3@hoboy.vegasvil.org> (raw)
In-Reply-To: <20230928133544.3642650-2-reibax@gmail.com>
On Thu, Sep 28, 2023 at 03:35:42PM +0200, Xabier Marquiegui wrote:
> diff --git a/drivers/ptp/ptp_chardev.c b/drivers/ptp/ptp_chardev.c
> index 362bf756e6b7..197edf1179f1 100644
> --- a/drivers/ptp/ptp_chardev.c
> +++ b/drivers/ptp/ptp_chardev.c
> @@ -435,10 +435,16 @@ long ptp_ioctl(struct posix_clock *pc, unsigned int cmd, unsigned long arg)
> __poll_t ptp_poll(struct posix_clock *pc, struct file *fp, poll_table *wait)
> {
> struct ptp_clock *ptp = container_of(pc, struct ptp_clock, clock);
> + struct timestamp_event_queue *queue;
>
> poll_wait(fp, &ptp->tsev_wq, wait);
>
> - return queue_cnt(&ptp->tsevq) ? EPOLLIN : 0;
> + /* Extract only the first element in the queue list
> + * TODO: Identify the relevant queue
Don't need todos, we see what is happening.
> @@ -228,7 +242,13 @@ struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info,
> ptp->info = info;
> ptp->devid = MKDEV(major, index);
> ptp->index = index;
> - spin_lock_init(&ptp->tsevq.lock);
> + INIT_LIST_HEAD(&ptp->tsevqs);
> + queue = kzalloc(sizeof(*queue), GFP_KERNEL);
> + if (!queue)
> + goto no_memory_queue;
> + spin_lock_init(&queue->lock);
> + list_add_tail(&queue->qlist, &ptp->tsevqs);
> + /* TODO - Transform or delete this mutex */
Again, no todos please, the patch that removes this mutex will/must
clearly justify the change.
> mutex_init(&ptp->tsevq_mux);
> mutex_init(&ptp->pincfg_mux);
> mutex_init(&ptp->n_vclocks_mux);
Thanks,
Richard
next prev parent reply other threads:[~2023-09-30 21:44 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-28 13:35 [PATCH net-next v3 0/3] ptp: Support for multiple filtered timestamp event queue readers Xabier Marquiegui
2023-09-28 13:35 ` [PATCH net-next v3 1/3] ptp: Replace timestamp event queue with linked list Xabier Marquiegui
2023-09-30 21:44 ` Richard Cochran [this message]
2023-09-28 13:35 ` [PATCH net-next v3 2/3] ptp: support multiple timestamp event readers Xabier Marquiegui
2023-09-29 23:43 ` Vinicius Costa Gomes
2023-09-30 21:57 ` Richard Cochran
2023-09-30 22:05 ` Richard Cochran
2023-09-30 22:10 ` Richard Cochran
2023-10-01 15:06 ` Simon Horman
2023-09-28 13:35 ` [PATCH net-next v3 3/3] ptp: support event queue reader channel masks Xabier Marquiegui
2023-09-30 0:03 ` Vinicius Costa Gomes
2023-09-30 8:01 ` Xabier Marquiegui
2023-10-02 22:54 ` Vinicius Costa Gomes
2023-09-30 22:37 ` Richard Cochran
2023-10-01 15:12 ` Simon Horman
2023-10-01 18:51 ` Richard Cochran
2023-09-29 23:39 ` [PATCH net-next v3 0/3] ptp: Support for multiple filtered timestamp event queue readers Vinicius Costa Gomes
2023-09-30 21:38 ` Richard Cochran
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=ZRiWq+GVZ9OjchR3@hoboy.vegasvil.org \
--to=richardcochran@gmail.com \
--cc=alex.maftei@amd.com \
--cc=chrony-dev@chrony.tuxfamily.org \
--cc=davem@davemloft.net \
--cc=horms@kernel.org \
--cc=mlichvar@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=ntp-lists@mattcorallo.com \
--cc=reibax@gmail.com \
--cc=rrameshbabu@nvidia.com \
--cc=shuah@kernel.org \
--cc=vinicius.gomes@intel.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).