From: Murali Karicheri <m-karicheri2@ti.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: <linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>,
<davem@davemloft.net>
Subject: Re: [PATCH v1 3/4] net: netcp: rename {get/set}pad_info to {get/set}_sw_data
Date: Fri, 19 Feb 2016 12:22:20 -0500 [thread overview]
Message-ID: <56C74F4C.8060005@ti.com> (raw)
In-Reply-To: <3448016.8sm2r4rFcb@wuerfel>
On 02/19/2016 09:37 AM, Arnd Bergmann wrote:
> On Thursday 18 February 2016 14:46:16 Murali Karicheri wrote:
>> Rename the helpers to match with the updated dma desc field sw_data.
>>
>> Cc: Wingman Kwok <w-kwok2@ti.com>
>> Cc: Mugunthan V N <mugunthanvnm@ti.com>
>> CC: Arnd Bergmann <arnd@arndb.de>
>> CC: Grygorii Strashko <grygorii.strashko@ti.com>
>> CC: David Laight <David.Laight@ACULAB.COM>
>> Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
>> ---
>> v1 - new patch to based on discussion at
>> https://patchwork.ozlabs.org/patch/580860/
>> drivers/net/ethernet/ti/netcp_core.c | 40 +++++++++++++++++++-----------------
>> 1 file changed, 21 insertions(+), 19 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/ti/netcp_core.c b/drivers/net/ethernet/ti/netcp_core.c
>> index 0b26e52..1d07cca 100644
>> --- a/drivers/net/ethernet/ti/netcp_core.c
>> +++ b/drivers/net/ethernet/ti/netcp_core.c
>> @@ -117,10 +117,11 @@ static void get_pkt_info(dma_addr_t *buff, u32 *buff_len, dma_addr_t *ndesc,
>> *ndesc = le32_to_cpu(desc->next_desc);
>> }
>>
>> -static void get_pad_info(u32 *pad0, u32 *pad1, struct knav_dma_desc *desc)
>> +static void get_sw_data(u32 *data0, u32 *data1, struct knav_dma_desc *desc)
>> {
>> - *pad0 = le32_to_cpu(desc->pad[0]);
>> - *pad1 = le32_to_cpu(desc->pad[1]);
>> + /* No Endian conversion needed as this data is untouched by hw */
>> + *data0 = desc->sw_data[0];
>> + *data1 = desc->sw_data[1];
>> }
>
> Actually this needs to be done together with patch 2, or you
> get a build failure if this one is not yet applied.
>
>> @@ -1174,7 +1176,7 @@ static int netcp_tx_submit_skb(struct netcp_intf *netcp,
>> }
>>
>> set_words(&tmp, 1, &desc->packet_info);
>> - set_words((u32 *)&skb, 1, &desc->pad[0]);
>> + set_words((u32 *)&skb, 1, &desc->sw_data[0]);
>>
>> if (tx_pipe->flags & SWITCH_TO_PORT_IN_TAGINFO) {
>> tmp = tx_pipe->switch_to_port;
>>
>
> This seems to introduce a bug, and should produce an "sparse" warning
> about a u32 being passed into a function expecting a __le32.
>
The fix is to use set_sw_data() instead. I could reproduce the sparse
warning you mentioned and fixed using the above. Will be part of v2.
> The other bug I originally tried to address here is the way an indirect
> pointer is converted to a 'u32' pointer, which won't work on 64-bit
> architectures when pointers are wider than u32. Maybe at least put a
> comment here that this is a known deficiency.
Will add a comment here and other possible places we do similar things as
much as I can.
Murali
>
> Arnd
>
--
Murali Karicheri
Linux Kernel, Keystone
next prev parent reply other threads:[~2016-02-19 17:22 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-18 19:46 [PATCH v1 1/4] net: ti: netcp: restore get/set_pad_info() functionality Murali Karicheri
2016-02-18 19:46 ` [PATCH v1 2/4] soc: ti: knav_dma: rename pad in struct knav_dma_desc to sw_data Murali Karicheri
2016-02-19 14:33 ` Arnd Bergmann
2016-02-18 19:46 ` [PATCH v1 3/4] net: netcp: rename {get/set}pad_info to {get/set}_sw_data Murali Karicheri
2016-02-19 14:37 ` Arnd Bergmann
2016-02-19 16:49 ` Murali Karicheri
2016-02-19 17:22 ` Murali Karicheri [this message]
2016-02-18 19:46 ` [PATCH v1 4/4] net: netcp: rework the code for get/set sw_data in dma desc Murali Karicheri
2016-02-19 14:41 ` [PATCH v1 1/4] net: ti: netcp: restore get/set_pad_info() functionality Arnd Bergmann
2016-02-19 15:48 ` Murali Karicheri
2016-02-19 16:41 ` Arnd Bergmann
2016-02-19 16:48 ` Murali Karicheri
2016-02-19 18:01 ` Murali Karicheri
2016-02-19 20:59 ` Arnd Bergmann
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=56C74F4C.8060005@ti.com \
--to=m-karicheri2@ti.com \
--cc=arnd@arndb.de \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.