* [PATCH 0/2] x86: turn off wrongly enabled CONFIG_GENERIC_HWEIGHT
@ 2019-02-18 5:59 Masahiro Yamada
2019-02-18 5:59 ` [PATCH 1/2] wireless: mt76: call hweight8() instead of __sw_hweight8() Masahiro Yamada
0 siblings, 1 reply; 8+ messages in thread
From: Masahiro Yamada @ 2019-02-18 5:59 UTC (permalink / raw)
To: Ingo Molnar, Thomas Gleixner, Borislav Petkov, H . Peter Anvin, x86
Cc: Matthias Brugger, netdev, linux-wireless, linux-kernel,
David S. Miller, Masahiro Yamada, linux-mediatek,
linux-arm-kernel, Lorenzo Bianconi, Christoph Hellwig,
Kalle Valo, Felix Fietkau
x86 should not enable CONFIG_GENERIC_HWEIGHT
because lib/hweight.c is not used by x86.
The only user is drivers/net/wireless/mediatek/mt76/mac80211.c
Of course, this driver is wrong since drivers should use the
generic API, hweight8().
After fixing it, x86 does not need to compile lib/hweight.c at all.
The real implementation is located in arch/x86/lib/hweight.S
Masahiro Yamada (2):
wireless: mt76: call hweight8() instead of __sw_hweight8()
x86: disable CONFIG_GENERIC_HWEIGHT and remove __HAVE_ARCH_SW_HWEIGHT
arch/x86/Kconfig | 3 ---
arch/x86/include/asm/arch_hweight.h | 2 --
drivers/net/wireless/mediatek/mt76/mac80211.c | 2 +-
lib/hweight.c | 4 ----
4 files changed, 1 insertion(+), 10 deletions(-)
--
2.7.4
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/2] wireless: mt76: call hweight8() instead of __sw_hweight8()
2019-02-18 5:59 [PATCH 0/2] x86: turn off wrongly enabled CONFIG_GENERIC_HWEIGHT Masahiro Yamada
@ 2019-02-18 5:59 ` Masahiro Yamada
2019-02-18 18:08 ` Kalle Valo
0 siblings, 1 reply; 8+ messages in thread
From: Masahiro Yamada @ 2019-02-18 5:59 UTC (permalink / raw)
To: Ingo Molnar, Thomas Gleixner, Borislav Petkov, H . Peter Anvin, x86
Cc: Matthias Brugger, netdev, linux-wireless, linux-kernel,
David S. Miller, Masahiro Yamada, linux-mediatek,
linux-arm-kernel, Lorenzo Bianconi, Christoph Hellwig,
Kalle Valo, Felix Fietkau
__sw_hweight8() is just internal implementation.
Drivers should use the common API, hweight8().
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
This patch should go to x86 tree along with 2/2.
Otherwise, all{yes,mod}config of x86 would be broken.
This patch is trivial enough.
I want ACK from the net/wireless maintainer
so that this can go in via x86 tree.
drivers/net/wireless/mediatek/mt76/mac80211.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mac80211.c b/drivers/net/wireless/mediatek/mt76/mac80211.c
index 7b926df..c42e0d3 100644
--- a/drivers/net/wireless/mediatek/mt76/mac80211.c
+++ b/drivers/net/wireless/mediatek/mt76/mac80211.c
@@ -124,7 +124,7 @@ static void mt76_init_stream_cap(struct mt76_dev *dev,
bool vht)
{
struct ieee80211_sta_ht_cap *ht_cap = &sband->ht_cap;
- int i, nstream = __sw_hweight8(dev->antenna_mask);
+ int i, nstream = hweight8(dev->antenna_mask);
struct ieee80211_sta_vht_cap *vht_cap;
u16 mcs_map = 0;
--
2.7.4
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] wireless: mt76: call hweight8() instead of __sw_hweight8()
2019-02-18 5:59 ` [PATCH 1/2] wireless: mt76: call hweight8() instead of __sw_hweight8() Masahiro Yamada
@ 2019-02-18 18:08 ` Kalle Valo
2019-02-18 19:06 ` Kalle Valo
0 siblings, 1 reply; 8+ messages in thread
From: Kalle Valo @ 2019-02-18 18:08 UTC (permalink / raw)
To: Masahiro Yamada
Cc: netdev, x86, linux-wireless, linux-kernel, David S. Miller,
Matthias Brugger, Ingo Molnar, Borislav Petkov, H . Peter Anvin,
Lorenzo Bianconi, linux-mediatek, Thomas Gleixner,
Christoph Hellwig, linux-arm-kernel, Felix Fietkau
Masahiro Yamada <yamada.masahiro@socionext.com> writes:
> __sw_hweight8() is just internal implementation.
>
> Drivers should use the common API, hweight8().
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Kalle Valo <kvalo@codeaurora.org>
> This patch should go to x86 tree along with 2/2.
>
> Otherwise, all{yes,mod}config of x86 would be broken.
>
> This patch is trivial enough.
> I want ACK from the net/wireless maintainer
> so that this can go in via x86 tree.
Sounds good to me, feel free to push via the x86 tree.
--
Kalle Valo
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] wireless: mt76: call hweight8() instead of __sw_hweight8()
2019-02-18 18:08 ` Kalle Valo
@ 2019-02-18 19:06 ` Kalle Valo
2019-02-18 19:20 ` Kalle Valo
0 siblings, 1 reply; 8+ messages in thread
From: Kalle Valo @ 2019-02-18 19:06 UTC (permalink / raw)
To: Masahiro Yamada
Cc: netdev, x86, linux-wireless, linux-kernel, David S. Miller,
Matthias Brugger, Ingo Molnar, Borislav Petkov, H . Peter Anvin,
Lorenzo Bianconi, linux-mediatek, Thomas Gleixner,
Christoph Hellwig, linux-arm-kernel, Felix Fietkau
Kalle Valo <kvalo@codeaurora.org> writes:
> Masahiro Yamada <yamada.masahiro@socionext.com> writes:
>
>> __sw_hweight8() is just internal implementation.
>>
>> Drivers should use the common API, hweight8().
>>
>> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
>
> Acked-by: Kalle Valo <kvalo@codeaurora.org>
>
>> This patch should go to x86 tree along with 2/2.
>>
>> Otherwise, all{yes,mod}config of x86 would be broken.
>>
>> This patch is trivial enough.
>> I want ACK from the net/wireless maintainer
>> so that this can go in via x86 tree.
>
> Sounds good to me, feel free to push via the x86 tree.
Actually, can you wait a bit? Felix just reminded me that we have a
similar patch pending from Ben Hutchings:
https://patchwork.kernel.org/patch/10808203/
And it seems there are two instances of __sw_hweight8, at least in my
wireless-drivers-next tree:
drivers/net/wireless/mediatek/mt76/mac80211.c: int i, nstream = __sw_hweight8(dev->antenna_mask);
drivers/net/wireless/mediatek/mt76/mac80211.c: int n_chains = __sw_hweight8(dev->antenna_mask);
So we need to think what to do.
--
Kalle Valo
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] wireless: mt76: call hweight8() instead of __sw_hweight8()
2019-02-18 19:06 ` Kalle Valo
@ 2019-02-18 19:20 ` Kalle Valo
2019-02-18 21:49 ` Borislav Petkov
2019-02-19 1:13 ` Masahiro Yamada
0 siblings, 2 replies; 8+ messages in thread
From: Kalle Valo @ 2019-02-18 19:20 UTC (permalink / raw)
To: Masahiro Yamada
Cc: netdev, x86, linux-wireless, linux-kernel, David S. Miller,
Matthias Brugger, Ingo Molnar, Borislav Petkov, H . Peter Anvin,
Lorenzo Bianconi, linux-mediatek, Thomas Gleixner,
Christoph Hellwig, linux-arm-kernel, Felix Fietkau
Kalle Valo <kvalo@codeaurora.org> writes:
> Kalle Valo <kvalo@codeaurora.org> writes:
>
>> Masahiro Yamada <yamada.masahiro@socionext.com> writes:
>>
>>> __sw_hweight8() is just internal implementation.
>>>
>>> Drivers should use the common API, hweight8().
>>>
>>> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
>>
>> Acked-by: Kalle Valo <kvalo@codeaurora.org>
>>
>>> This patch should go to x86 tree along with 2/2.
>>>
>>> Otherwise, all{yes,mod}config of x86 would be broken.
>>>
>>> This patch is trivial enough.
>>> I want ACK from the net/wireless maintainer
>>> so that this can go in via x86 tree.
>>
>> Sounds good to me, feel free to push via the x86 tree.
>
> Actually, can you wait a bit? Felix just reminded me that we have a
> similar patch pending from Ben Hutchings:
>
> https://patchwork.kernel.org/patch/10808203/
>
> And it seems there are two instances of __sw_hweight8, at least in my
> wireless-drivers-next tree:
>
> drivers/net/wireless/mediatek/mt76/mac80211.c: int i, nstream =
> __sw_hweight8(dev->antenna_mask);
> drivers/net/wireless/mediatek/mt76/mac80211.c: int n_chains =
> __sw_hweight8(dev->antenna_mask);
>
> So we need to think what to do.
I think the best would be that Felix applies Ben's patch to the wireless
tree and I'll push it to Linus during the next merge window (via
net-next). Simpler and less conflicts that way.
So Masahiro, could you hold your x86 patch for a while until the mt76
patch will be in Linus' tree? That should not take more than two weeks,
I think.
--
Kalle Valo
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] wireless: mt76: call hweight8() instead of __sw_hweight8()
2019-02-18 19:20 ` Kalle Valo
@ 2019-02-18 21:49 ` Borislav Petkov
2019-02-19 1:13 ` Masahiro Yamada
1 sibling, 0 replies; 8+ messages in thread
From: Borislav Petkov @ 2019-02-18 21:49 UTC (permalink / raw)
To: Kalle Valo
Cc: netdev, x86, linux-wireless, linux-kernel, David S. Miller,
Masahiro Yamada, Ingo Molnar, linux-mediatek, Matthias Brugger,
H . Peter Anvin, Lorenzo Bianconi, Thomas Gleixner,
Christoph Hellwig, linux-arm-kernel, Felix Fietkau
On Mon, Feb 18, 2019 at 09:20:46PM +0200, Kalle Valo wrote:
> So Masahiro, could you hold your x86 patch for a while until the mt76
> patch will be in Linus' tree? That should not take more than two weeks,
> I think.
No hurry - I won't take it into the x86 now and queue it for 5.1 because
it is not something urgent or fixing a bug or so. It is a cleanup and as
such it can surely wait for 5.2, I'd say. Unless there are other aspects
which I'm not thinking of right now...
Thx.
--
Regards/Gruss,
Boris.
Good mailing practices for 400: avoid top-posting and trim the reply.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] wireless: mt76: call hweight8() instead of __sw_hweight8()
2019-02-18 19:20 ` Kalle Valo
2019-02-18 21:49 ` Borislav Petkov
@ 2019-02-19 1:13 ` Masahiro Yamada
2019-02-19 4:06 ` Kalle Valo
1 sibling, 1 reply; 8+ messages in thread
From: Masahiro Yamada @ 2019-02-19 1:13 UTC (permalink / raw)
To: Kalle Valo
Cc: Networking, X86 ML, linux-wireless, Linux Kernel Mailing List,
David S. Miller, Matthias Brugger, Ingo Molnar, Borislav Petkov,
H . Peter Anvin, Lorenzo Bianconi,
moderated list:ARM/Mediatek SoC support, Thomas Gleixner,
Christoph Hellwig, linux-arm-kernel, Felix Fietkau
On Tue, Feb 19, 2019 at 4:38 AM Kalle Valo <kvalo@codeaurora.org> wrote:
>
> Kalle Valo <kvalo@codeaurora.org> writes:
>
> > Kalle Valo <kvalo@codeaurora.org> writes:
> >
> >> Masahiro Yamada <yamada.masahiro@socionext.com> writes:
> >>
> >>> __sw_hweight8() is just internal implementation.
> >>>
> >>> Drivers should use the common API, hweight8().
> >>>
> >>> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> >>
> >> Acked-by: Kalle Valo <kvalo@codeaurora.org>
> >>
> >>> This patch should go to x86 tree along with 2/2.
> >>>
> >>> Otherwise, all{yes,mod}config of x86 would be broken.
> >>>
> >>> This patch is trivial enough.
> >>> I want ACK from the net/wireless maintainer
> >>> so that this can go in via x86 tree.
> >>
> >> Sounds good to me, feel free to push via the x86 tree.
> >
> > Actually, can you wait a bit? Felix just reminded me that we have a
> > similar patch pending from Ben Hutchings:
> >
> > https://patchwork.kernel.org/patch/10808203/
> >
> > And it seems there are two instances of __sw_hweight8, at least in my
> > wireless-drivers-next tree:
> >
> > drivers/net/wireless/mediatek/mt76/mac80211.c: int i, nstream =
> > __sw_hweight8(dev->antenna_mask);
> > drivers/net/wireless/mediatek/mt76/mac80211.c: int n_chains =
> > __sw_hweight8(dev->antenna_mask);
> >
> > So we need to think what to do.
>
> I think the best would be that Felix applies Ben's patch to the wireless
> tree and I'll push it to Linus during the next merge window (via
> net-next). Simpler and less conflicts that way.
>
> So Masahiro, could you hold your x86 patch for a while until the mt76
> patch will be in Linus' tree? That should not take more than two weeks,
> I think.
Sure.
I will resend 2/2 later.
--
Best Regards
Masahiro Yamada
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] wireless: mt76: call hweight8() instead of __sw_hweight8()
2019-02-19 1:13 ` Masahiro Yamada
@ 2019-02-19 4:06 ` Kalle Valo
0 siblings, 0 replies; 8+ messages in thread
From: Kalle Valo @ 2019-02-19 4:06 UTC (permalink / raw)
To: Masahiro Yamada
Cc: Networking, X86 ML, linux-wireless, Linux Kernel Mailing List,
David S. Miller, Matthias Brugger, Ingo Molnar, Borislav Petkov,
H . Peter Anvin, Lorenzo Bianconi,
moderated list:ARM/Mediatek SoC support, Thomas Gleixner,
Christoph Hellwig, linux-arm-kernel, Felix Fietkau
Masahiro Yamada <yamada.masahiro@socionext.com> writes:
> On Tue, Feb 19, 2019 at 4:38 AM Kalle Valo <kvalo@codeaurora.org> wrote:
>>
>> Kalle Valo <kvalo@codeaurora.org> writes:
>>
>> > Kalle Valo <kvalo@codeaurora.org> writes:
>> >
>> >> Masahiro Yamada <yamada.masahiro@socionext.com> writes:
>> >>
>> >>> __sw_hweight8() is just internal implementation.
>> >>>
>> >>> Drivers should use the common API, hweight8().
>> >>>
>> >>> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
>> >>
>> >> Acked-by: Kalle Valo <kvalo@codeaurora.org>
>> >>
>> >>> This patch should go to x86 tree along with 2/2.
>> >>>
>> >>> Otherwise, all{yes,mod}config of x86 would be broken.
>> >>>
>> >>> This patch is trivial enough.
>> >>> I want ACK from the net/wireless maintainer
>> >>> so that this can go in via x86 tree.
>> >>
>> >> Sounds good to me, feel free to push via the x86 tree.
>> >
>> > Actually, can you wait a bit? Felix just reminded me that we have a
>> > similar patch pending from Ben Hutchings:
>> >
>> > https://patchwork.kernel.org/patch/10808203/
>> >
>> > And it seems there are two instances of __sw_hweight8, at least in my
>> > wireless-drivers-next tree:
>> >
>> > drivers/net/wireless/mediatek/mt76/mac80211.c: int i, nstream =
>> > __sw_hweight8(dev->antenna_mask);
>> > drivers/net/wireless/mediatek/mt76/mac80211.c: int n_chains =
>> > __sw_hweight8(dev->antenna_mask);
>> >
>> > So we need to think what to do.
>>
>> I think the best would be that Felix applies Ben's patch to the wireless
>> tree and I'll push it to Linus during the next merge window (via
>> net-next). Simpler and less conflicts that way.
>>
>> So Masahiro, could you hold your x86 patch for a while until the mt76
>> patch will be in Linus' tree? That should not take more than two weeks,
>> I think.
>
> Sure.
> I will resend 2/2 later.
Great, thanks!
--
Kalle Valo
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2019-02-19 4:07 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-18 5:59 [PATCH 0/2] x86: turn off wrongly enabled CONFIG_GENERIC_HWEIGHT Masahiro Yamada
2019-02-18 5:59 ` [PATCH 1/2] wireless: mt76: call hweight8() instead of __sw_hweight8() Masahiro Yamada
2019-02-18 18:08 ` Kalle Valo
2019-02-18 19:06 ` Kalle Valo
2019-02-18 19:20 ` Kalle Valo
2019-02-18 21:49 ` Borislav Petkov
2019-02-19 1:13 ` Masahiro Yamada
2019-02-19 4:06 ` Kalle Valo
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).