[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1bbe7772-09f4-6c5a-8c4d-c88988b34c99@gmail.com>
Date: Tue, 5 Sep 2023 21:57:52 +0530
From: Ayush Singh <ayushdevel1325@...il.com>
To: Krzysztof Kozlowski <krzk@...nel.org>, greybus-dev@...ts.linaro.org
Cc: devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
gregkh@...uxfoundation.org,
Vaishnav M A <vaishnav@...gleboard.org>,
Jason Kridner <jkridner@...gleboard.org>,
Nishanth Menon <nm@...com>
Subject: Re: [PATCH v4 2/3] greybus: Add BeaglePlay Linux Driver
>> +static void hdlc_handle_rx_frame(struct gb_beagleplay *bg)
>> +{
>> + u8 address = bg->rx_buffer[0];
>> + char *buffer = &bg->rx_buffer[2];
>> + size_t buffer_len = bg->rx_buffer_len - 4;
>> +
>> + switch (address) {
>> + case ADDRESS_DBG:
>> + hdlc_handle_dbg_frame(bg, buffer, buffer_len);
>> + break;
>> + case ADDRESS_GREYBUS:
>> + hdlc_handle_greybus_frame(bg, buffer, buffer_len);
>> + break;
>> + default:
>> + dev_warn(&bg->serdev->dev, "Got Unknown Frame %u", address);
> ratelimit
> Probably as well in several places with possible flooding.
I don't think `hdlc_handle_rx_frame` is the correct place since it only
processes a single completed HDLC frame. The more appropriate place
would be `hdlc_rx` if we want to limit based on the number of HDLC
frames or `gb_beagleplay_tty_receive` to limit based on the number of bytes.
I would like to ask, though, why is rate limiting required here? Won't
`serdev_device_ops->receive_buf` already rate limit the number of bytes
somewhat? Or is it related to blocking in the
`serdev_device_ops->receive_buf` callback? In the case of latter, it
would probably make sense to ratelimit based on number of frames, I think.
Ayush Singh
Powered by blists - more mailing lists