Re: Anyone have a clone of wireless-legacy.git?

2016-06-02 Thread Guenter Roeck
On Thu, Jun 02, 2016 at 02:38:04PM -0400, John W. Linville wrote:
> It has recently come to my attention that the old wireless-legacy.git
> tree is no longer available on kernel.org.  I honestly have no idea
> what happened to it -- for all I know I fat-fingered it some time
> ago or whatever.  Anyway, apparently there are some references in it
> "out there" and it would be good if we had a copy available somewhere
> public.
> 
> If you have an old clone of wireless-legacy.git, PLEASE DO NOT DELETE
> IT!  Please let me know that you've got it and I will arrange to get
> a copy of it from you in order to make it available publicly again.
> 
> I appreciate your support!
> 
http://www.filewatcher.com/_/?q=wireless-legacy.git, maybe ?

Guenter
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Anyone have a clone of wireless-legacy.git?

2016-06-03 Thread Guenter Roeck
On Fri, Jun 03, 2016 at 10:34:08AM -0400, John W. Linville wrote:
> On Fri, Jun 03, 2016 at 09:06:23AM +0200, Johannes Berg wrote:
> > 
> > > http://www.filewatcher.com/_/?q=wireless-legacy.git, maybe ?
> > > 
> > 
> > Seems to work - both have the same branches:
> > 
> >   adm8211 72c942ed694e [PATCH] adm8211: fix build breakage 
> > from skb->mac.raw
> >   at76279f8592e428 cfg80211: keep track of supported 
> > interface modes (at76)
> >   ath5k   8584ac94e3bb [PATCH] ath5k: Internalize Atheros 
> > Turbo modes
> >   ath5k-2008-01-215b8ca29e11b5 ath5k: remove duplicate bssid 
> > variable
> >   mac80211-attic  2bc68d999610 [PATCH] mac80211: remove scan struct 
> > from hostapd_param
> >   mac80211-dungeonad097a32e9ad [PATCH] mac80211 [HT] 802.11 code 
> > compiles under CONFIG_MAC80211_HT
> >   prism54usb  101e59f5e18a prism54usb: more fix for wireless 
> > Kconfig changes
> >   rtl8180-2008-01-21  55fc0e806a93 rtl8180: remove calibration error 
> > message for rtl8225z2
> >   tiacx   d6a6811c508b [PATCH] TI acx100/acx111: Make debug 
> > level selectable in configuration
> >   wireless-dev-2007-08-10 ca29ec8f05c1 Merge ../wireless-dev-legacy into 
> > wireless-dev-2007-08-10
> >   wireless-dev-2007-09-24 cd799e167394 Merge branch 'p54' into everything
> > 
> > johannes
> 
> I got them both from the two FTP sites, and both git repos appear to
> be identical.  It would be best if someone had an actual record of
> the commit hash values, but this might be the best I/we can do...?
> 
We do know this published SHA:

c1928199c27de433d1e81b78e3178be4f0e978d2

from the ath5k legal analysis.

There are a couple of hits for 72c942ed694ef6249c0df84c0802e7378884e7c7,
which is the full SHA for the adm8211 branch.

There are also lots of hits for 6a55617ed5d1aa62b850de2cf66f5ede2eef4825,
which I think is the master branch SHA, and is in the upstream kernel.

Guenter
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] libertas_tf: Drop unused variable and define

2016-06-03 Thread Guenter Roeck
gcc-6 reports:

drivers/net/wireless/marvell/libertas_tf/main.c:30:19: error:
'lbtf_driver_version' defined but not used

with -Werror=unused-const-variable=.

Reported-by: Fengguang Wu  [0-day test robot]
Signed-off-by: Guenter Roeck 
---
 drivers/net/wireless/marvell/libertas_tf/main.c | 7 ---
 1 file changed, 7 deletions(-)

diff --git a/drivers/net/wireless/marvell/libertas_tf/main.c 
b/drivers/net/wireless/marvell/libertas_tf/main.c
index 0bf8916a02cf..75bf0c8a2f6f 100644
--- a/drivers/net/wireless/marvell/libertas_tf/main.c
+++ b/drivers/net/wireless/marvell/libertas_tf/main.c
@@ -16,7 +16,6 @@
 #include 
 #include "libertas_tf.h"
 
-#define DRIVER_RELEASE_VERSION "004.p0"
 /* thinfirm version: 5.132.X.pX */
 #define LBTF_FW_VER_MIN0x05840300
 #define LBTF_FW_VER_MAX0x0584
@@ -27,12 +26,6 @@ unsigned int lbtf_debug;
 EXPORT_SYMBOL_GPL(lbtf_debug);
 module_param_named(libertas_tf_debug, lbtf_debug, int, 0644);
 
-static const char lbtf_driver_version[] = "THINFIRM-USB8388-" 
DRIVER_RELEASE_VERSION
-#ifdef DEBUG
-   "-dbg"
-#endif
-   "";
-
 struct workqueue_struct *lbtf_wq;
 
 static const struct ieee80211_channel lbtf_channels[] = {
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] b43: Remove unused phy_a code

2016-06-03 Thread Guenter Roeck
gcc-6 reports the following error with -Werror=unused-const-variable.

drivers/net/wireless/broadcom/b43/phy_a.c:576:40: error:
'b43_phyops_a' defined but not used

Turns out a lot of code in this file is unused, so let's remove it.

Reported-by: Fengguang Wu  [0-day test robot]
Signed-off-by: Guenter Roeck 
---
 drivers/net/wireless/broadcom/b43/phy_a.c | 298 --
 1 file changed, 298 deletions(-)

diff --git a/drivers/net/wireless/broadcom/b43/phy_a.c 
b/drivers/net/wireless/broadcom/b43/phy_a.c
index 99c036f5ecb7..d9212dc276d0 100644
--- a/drivers/net/wireless/broadcom/b43/phy_a.c
+++ b/drivers/net/wireless/broadcom/b43/phy_a.c
@@ -60,25 +60,6 @@ static inline u16 freq_r3A_value(u16 frequency)
return value;
 }
 
-#if 0
-/* This function converts a TSSI value to dBm in Q5.2 */
-static s8 b43_aphy_estimate_power_out(struct b43_wldev *dev, s8 tssi)
-{
-   struct b43_phy *phy = &dev->phy;
-   struct b43_phy_a *aphy = phy->a;
-   s8 dbm = 0;
-   s32 tmp;
-
-   tmp = (aphy->tgt_idle_tssi - aphy->cur_idle_tssi + tssi);
-   tmp += 0x80;
-   tmp = clamp_val(tmp, 0x00, 0xFF);
-   dbm = aphy->tssi2dbm[tmp];
-   //TODO: There's a FIXME on the specs
-
-   return dbm;
-}
-#endif
-
 static void b43_radio_set_tx_iq(struct b43_wldev *dev)
 {
static const u8 data_high[5] = { 0x00, 0x40, 0x80, 0x90, 0xD0 };
@@ -314,282 +295,3 @@ void b43_phy_inita(struct b43_wldev *dev)
b43_phy_maskset(dev, B43_PHY_OFDM(0x6E), 0xE000, 0x3CF);
}
 }
-
-/* Initialise the TSSI->dBm lookup table */
-static int b43_aphy_init_tssi2dbm_table(struct b43_wldev *dev)
-{
-   struct b43_phy *phy = &dev->phy;
-   struct b43_phy_a *aphy = phy->a;
-   s16 pab0, pab1, pab2;
-
-   pab0 = (s16) (dev->dev->bus_sprom->pa1b0);
-   pab1 = (s16) (dev->dev->bus_sprom->pa1b1);
-   pab2 = (s16) (dev->dev->bus_sprom->pa1b2);
-
-   if (pab0 != 0 && pab1 != 0 && pab2 != 0 &&
-   pab0 != -1 && pab1 != -1 && pab2 != -1) {
-   /* The pabX values are set in SPROM. Use them. */
-   if ((s8) dev->dev->bus_sprom->itssi_a != 0 &&
-   (s8) dev->dev->bus_sprom->itssi_a != -1)
-   aphy->tgt_idle_tssi =
-   (s8) (dev->dev->bus_sprom->itssi_a);
-   else
-   aphy->tgt_idle_tssi = 62;
-   aphy->tssi2dbm = b43_generate_dyn_tssi2dbm_tab(dev, pab0,
-  pab1, pab2);
-   if (!aphy->tssi2dbm)
-   return -ENOMEM;
-   } else {
-   /* pabX values not set in SPROM,
-* but APHY needs a generated table. */
-   aphy->tssi2dbm = NULL;
-   b43err(dev->wl, "Could not generate tssi2dBm "
-  "table (wrong SPROM info)!\n");
-   return -ENODEV;
-   }
-
-   return 0;
-}
-
-static int b43_aphy_op_allocate(struct b43_wldev *dev)
-{
-   struct b43_phy_a *aphy;
-   int err;
-
-   aphy = kzalloc(sizeof(*aphy), GFP_KERNEL);
-   if (!aphy)
-   return -ENOMEM;
-   dev->phy.a = aphy;
-
-   err = b43_aphy_init_tssi2dbm_table(dev);
-   if (err)
-   goto err_free_aphy;
-
-   return 0;
-
-err_free_aphy:
-   kfree(aphy);
-   dev->phy.a = NULL;
-
-   return err;
-}
-
-static void b43_aphy_op_prepare_structs(struct b43_wldev *dev)
-{
-   struct b43_phy *phy = &dev->phy;
-   struct b43_phy_a *aphy = phy->a;
-   const void *tssi2dbm;
-   int tgt_idle_tssi;
-
-   /* tssi2dbm table is constant, so it is initialized at alloc time.
-* Save a copy of the pointer. */
-   tssi2dbm = aphy->tssi2dbm;
-   tgt_idle_tssi = aphy->tgt_idle_tssi;
-
-   /* Zero out the whole PHY structure. */
-   memset(aphy, 0, sizeof(*aphy));
-
-   aphy->tssi2dbm = tssi2dbm;
-   aphy->tgt_idle_tssi = tgt_idle_tssi;
-
-   //TODO init struct b43_phy_a
-
-}
-
-static void b43_aphy_op_free(struct b43_wldev *dev)
-{
-   struct b43_phy *phy = &dev->phy;
-   struct b43_phy_a *aphy = phy->a;
-
-   kfree(aphy->tssi2dbm);
-   aphy->tssi2dbm = NULL;
-
-   kfree(aphy);
-   dev->phy.a = NULL;
-}
-
-static int b43_aphy_op_init(struct b43_wldev *dev)
-{
-   b43_phy_inita(dev);
-
-   return 0;
-}
-
-static inline u16 adjust_phyreg(struct b43_wldev *dev, u16 offset)
-{
-   /* OFDM registers are base-registers for the A-PHY. */
-   if ((offset & B43_PHYROUTE) == B43_PHYROUTE_OFDM_GPHY) {
-   offset &= ~B43_PHYROUTE;
-   offset |= B43_PHYROUTE_BASE;
-   }
-
-#if B43_DEB

[PATCH] iwlwifi: Remove unused array 'iwlagn_loose_lookup'

2016-06-03 Thread Guenter Roeck
gcc-6 reports the following error if -Werror=unused-const-variable
is enabled.

drivers/net/wireless/intel/iwlwifi/dvm/lib.c:210:21: error:
'iwlagn_loose_lookup' defined but not used

Signed-off-by: Guenter Roeck 
---
 drivers/net/wireless/intel/iwlwifi/dvm/lib.c | 17 -
 1 file changed, 17 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/dvm/lib.c 
b/drivers/net/wireless/intel/iwlwifi/dvm/lib.c
index 8dda52ae3bb5..6c2d6da7eec6 100644
--- a/drivers/net/wireless/intel/iwlwifi/dvm/lib.c
+++ b/drivers/net/wireless/intel/iwlwifi/dvm/lib.c
@@ -205,23 +205,6 @@ static const __le32 
iwlagn_def_3w_lookup[IWLAGN_BT_DECISION_LUT_SIZE] = {
cpu_to_le32(0xf0005000),
 };
 
-
-/* Loose Coex */
-static const __le32 iwlagn_loose_lookup[IWLAGN_BT_DECISION_LUT_SIZE] = {
-   cpu_to_le32(0x),
-   cpu_to_le32(0x),
-   cpu_to_le32(0xaeaa),
-   cpu_to_le32(0x),
-   cpu_to_le32(0xcc00ff28),
-   cpu_to_le32(0x),
-   cpu_to_le32(0xcc00),
-   cpu_to_le32(0x),
-   cpu_to_le32(0x),
-   cpu_to_le32(0x),
-   cpu_to_le32(0xf0005000),
-   cpu_to_le32(0xf0005000),
-};
-
 /* Full concurrency */
 static const __le32 iwlagn_concurrent_lookup[IWLAGN_BT_DECISION_LUT_SIZE] = {
cpu_to_le32(0x),
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] b43: Remove unused phy_a code

2016-06-03 Thread Guenter Roeck

On 06/03/2016 02:35 PM, Michael Büsch wrote:

On Fri,  3 Jun 2016 14:32:46 -0700
Guenter Roeck  wrote:


gcc-6 reports the following error with -Werror=unused-const-variable.

drivers/net/wireless/broadcom/b43/phy_a.c:576:40: error:
'b43_phyops_a' defined but not used

Turns out a lot of code in this file is unused, so let's remove it.



All a-phy code is usused.
So you can basically remove the whole file and any other A-PHY code.


I love removing code. I'll resend with more code removed.

Guenter

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 1/2] b43: Remove unused phy_a code

2016-06-03 Thread Guenter Roeck
gcc-6 reports the following error with -Werror=unused-const-variable.

drivers/net/wireless/broadcom/b43/phy_a.c:576:40: error:
'b43_phyops_a' defined but not used

Per Michael Büsch: "All a-phy code is usused", so remove phy_a.c
completely. Move the remaining Type-G initialization code into phy_g.c.

Reported-by: Fengguang Wu  [0-day test robot]
Signed-off-by: Guenter Roeck 
---
v2: Remove phy_a.c; move left-over code into phy_g.c
Remove now unused data structure

 drivers/net/wireless/broadcom/b43/Makefile |   2 +-
 drivers/net/wireless/broadcom/b43/phy_a.c  | 595 -
 drivers/net/wireless/broadcom/b43/phy_a.h  |  22 -
 drivers/net/wireless/broadcom/b43/phy_common.h |   3 -
 drivers/net/wireless/broadcom/b43/phy_g.c  |  27 +-
 5 files changed, 22 insertions(+), 627 deletions(-)
 delete mode 100644 drivers/net/wireless/broadcom/b43/phy_a.c

diff --git a/drivers/net/wireless/broadcom/b43/Makefile 
b/drivers/net/wireless/broadcom/b43/Makefile
index ddc4df46656f..27fab958e3d5 100644
--- a/drivers/net/wireless/broadcom/b43/Makefile
+++ b/drivers/net/wireless/broadcom/b43/Makefile
@@ -1,6 +1,6 @@
 b43-y  += main.o
 b43-y  += bus.o
-b43-$(CONFIG_B43_PHY_G)+= phy_a.o phy_g.o tables.o lo.o wa.o
+b43-$(CONFIG_B43_PHY_G)+= phy_g.o tables.o lo.o wa.o
 b43-$(CONFIG_B43_PHY_N)+= tables_nphy.o
 b43-$(CONFIG_B43_PHY_N)+= radio_2055.o
 b43-$(CONFIG_B43_PHY_N)+= radio_2056.o
diff --git a/drivers/net/wireless/broadcom/b43/phy_a.c 
b/drivers/net/wireless/broadcom/b43/phy_a.c
deleted file mode 100644
index 99c036f5ecb7..
--- a/drivers/net/wireless/broadcom/b43/phy_a.c
+++ /dev/null
@@ -1,595 +0,0 @@
-/*
-
-  Broadcom B43 wireless driver
-  IEEE 802.11a PHY driver
-
-  Copyright (c) 2005 Martin Langer ,
-  Copyright (c) 2005-2007 Stefano Brivio 
-  Copyright (c) 2005-2008 Michael Buesch 
-  Copyright (c) 2005, 2006 Danny van Dyk 
-  Copyright (c) 2005, 2006 Andreas Jaggi 
-
-  This program is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; either version 2 of the License, or
-  (at your option) any later version.
-
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with this program; see the file COPYING.  If not, write to
-  the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor,
-  Boston, MA 02110-1301, USA.
-
-*/
-
-#include 
-
-#include "b43.h"
-#include "phy_a.h"
-#include "phy_common.h"
-#include "wa.h"
-#include "tables.h"
-#include "main.h"
-
-
-/* Get the freq, as it has to be written to the device. */
-static inline u16 channel2freq_a(u8 channel)
-{
-   B43_WARN_ON(channel > 200);
-
-   return (5000 + 5 * channel);
-}
-
-static inline u16 freq_r3A_value(u16 frequency)
-{
-   u16 value;
-
-   if (frequency < 5091)
-   value = 0x0040;
-   else if (frequency < 5321)
-   value = 0x;
-   else if (frequency < 5806)
-   value = 0x0080;
-   else
-   value = 0x0040;
-
-   return value;
-}
-
-#if 0
-/* This function converts a TSSI value to dBm in Q5.2 */
-static s8 b43_aphy_estimate_power_out(struct b43_wldev *dev, s8 tssi)
-{
-   struct b43_phy *phy = &dev->phy;
-   struct b43_phy_a *aphy = phy->a;
-   s8 dbm = 0;
-   s32 tmp;
-
-   tmp = (aphy->tgt_idle_tssi - aphy->cur_idle_tssi + tssi);
-   tmp += 0x80;
-   tmp = clamp_val(tmp, 0x00, 0xFF);
-   dbm = aphy->tssi2dbm[tmp];
-   //TODO: There's a FIXME on the specs
-
-   return dbm;
-}
-#endif
-
-static void b43_radio_set_tx_iq(struct b43_wldev *dev)
-{
-   static const u8 data_high[5] = { 0x00, 0x40, 0x80, 0x90, 0xD0 };
-   static const u8 data_low[5] = { 0x00, 0x01, 0x05, 0x06, 0x0A };
-   u16 tmp = b43_radio_read16(dev, 0x001E);
-   int i, j;
-
-   for (i = 0; i < 5; i++) {
-   for (j = 0; j < 5; j++) {
-   if (tmp == (data_high[i] << 4 | data_low[j])) {
-   b43_phy_write(dev, 0x0069,
- (i - j) << 8 | 0x00C0);
-   return;
-   }
-   }
-   }
-}
-
-static void aphy_channel_switch(struct b43_wldev *dev, unsigned int channel)
-{
-   u16 freq, r8, tmp;
-
-   freq = channel2freq_a(channel);
-
-   r8 = b43_radio_read16(dev, 0x0008);
-   b

[PATCH v2 2/2] b43: Completely remove support for phy_a

2016-06-03 Thread Guenter Roeck
Per Michael Büsch: "All a-phy code is usused", so remove it all.

Signed-off-by: Guenter Roeck 
---
v2: Added patch

 drivers/net/wireless/broadcom/b43/main.c |  31 +---
 drivers/net/wireless/broadcom/b43/wa.c   | 283 +++
 drivers/net/wireless/broadcom/b43/xmit.c |  17 +-
 3 files changed, 24 insertions(+), 307 deletions(-)

diff --git a/drivers/net/wireless/broadcom/b43/main.c 
b/drivers/net/wireless/broadcom/b43/main.c
index 4ee5c5853f9f..6e5d9095b195 100644
--- a/drivers/net/wireless/broadcom/b43/main.c
+++ b/drivers/net/wireless/broadcom/b43/main.c
@@ -3180,7 +3180,6 @@ static void b43_rate_memory_write(struct b43_wldev *dev, 
u16 rate, int is_ofdm)
 static void b43_rate_memory_init(struct b43_wldev *dev)
 {
switch (dev->phy.type) {
-   case B43_PHYTYPE_A:
case B43_PHYTYPE_G:
case B43_PHYTYPE_N:
case B43_PHYTYPE_LP:
@@ -3194,8 +3193,6 @@ static void b43_rate_memory_init(struct b43_wldev *dev)
b43_rate_memory_write(dev, B43_OFDM_RATE_36MB, 1);
b43_rate_memory_write(dev, B43_OFDM_RATE_48MB, 1);
b43_rate_memory_write(dev, B43_OFDM_RATE_54MB, 1);
-   if (dev->phy.type == B43_PHYTYPE_A)
-   break;
/* fallthrough */
case B43_PHYTYPE_B:
b43_rate_memory_write(dev, B43_CCK_RATE_1MB, 0);
@@ -4604,14 +4601,6 @@ static int b43_phy_versioning(struct b43_wldev *dev)
if (radio_manuf != 0x17F /* Broadcom */)
unsupported = 1;
switch (phy_type) {
-   case B43_PHYTYPE_A:
-   if (radio_id != 0x2060)
-   unsupported = 1;
-   if (radio_rev != 1)
-   unsupported = 1;
-   if (radio_manuf != 0x17F)
-   unsupported = 1;
-   break;
case B43_PHYTYPE_B:
if ((radio_id & 0xFFF0) != 0x2050)
unsupported = 1;
@@ -4766,10 +4755,7 @@ static void b43_set_synth_pu_delay(struct b43_wldev 
*dev, bool idle)
u16 pu_delay;
 
/* The time value is in microseconds. */
-   if (dev->phy.type == B43_PHYTYPE_A)
-   pu_delay = 3700;
-   else
-   pu_delay = 1050;
+   pu_delay = 1050;
if (b43_is_mode(dev->wl, NL80211_IFTYPE_ADHOC) || idle)
pu_delay = 500;
if ((dev->phy.radio_ver == 0x2050) && (dev->phy.radio_rev == 8))
@@ -4784,14 +4770,10 @@ static void b43_set_pretbtt(struct b43_wldev *dev)
u16 pretbtt;
 
/* The time value is in microseconds. */
-   if (b43_is_mode(dev->wl, NL80211_IFTYPE_ADHOC)) {
+   if (b43_is_mode(dev->wl, NL80211_IFTYPE_ADHOC))
pretbtt = 2;
-   } else {
-   if (dev->phy.type == B43_PHYTYPE_A)
-   pretbtt = 120;
-   else
-   pretbtt = 250;
-   }
+   else
+   pretbtt = 250;
b43_shm_write16(dev, B43_SHM_SHARED, B43_SHM_SH_PRETBTT, pretbtt);
b43_write16(dev, B43_MMIO_TSF_CFP_PRETBTT, pretbtt);
 }
@@ -5380,10 +5362,6 @@ static void b43_supported_bands(struct b43_wldev *dev, 
bool *have_2ghz_phy,
 
/* As a fallback, try to guess using PHY type */
switch (dev->phy.type) {
-   case B43_PHYTYPE_A:
-   *have_2ghz_phy = false;
-   *have_5ghz_phy = true;
-   return;
case B43_PHYTYPE_G:
case B43_PHYTYPE_N:
case B43_PHYTYPE_LP:
@@ -5455,7 +5433,6 @@ static int b43_wireless_core_attach(struct b43_wldev *dev)
/* We don't support 5 GHz on some PHYs yet */
if (have_5ghz_phy) {
switch (dev->phy.type) {
-   case B43_PHYTYPE_A:
case B43_PHYTYPE_G:
case B43_PHYTYPE_LP:
case B43_PHYTYPE_HT:
diff --git a/drivers/net/wireless/broadcom/b43/wa.c 
b/drivers/net/wireless/broadcom/b43/wa.c
index c218c08fb2f5..0e96c08d1e17 100644
--- a/drivers/net/wireless/broadcom/b43/wa.c
+++ b/drivers/net/wireless/broadcom/b43/wa.c
@@ -30,33 +30,6 @@
 #include "phy_common.h"
 #include "wa.h"
 
-static void b43_wa_papd(struct b43_wldev *dev)
-{
-   u16 backup;
-
-   backup = b43_ofdmtab_read16(dev, B43_OFDMTAB_PWRDYN2, 0);
-   b43_ofdmtab_write16(dev, B43_OFDMTAB_PWRDYN2, 0, 7);
-   b43_ofdmtab_write16(dev, B43_OFDMTAB_UNKNOWN_APHY, 0, 0);
-   b43_dummy_transmission(dev, true, true);
-   b43_ofdmtab_write16(dev, B43_OFDMTAB_PWRDYN2, 0, backup);
-}
-
-static void b43_wa_auxclipthr(struct b43_wldev *dev)
-{
-   b43_phy_write(dev, B43_PHY_OFDM(0x8E), 0x3800);
-}
-
-static void b43_wa_afcdac(struct b43_wldev *dev)
-{
-   b43_phy_write(dev, 0x0035, 0x03FF);
-   b43_phy_write(dev, 0x0036, 0x0400);
-}
-
-static void b43_wa_txdc_offset(struct b43_wldev *dev)
-{
-   b43_ofdmtab_write16(de

[PATCH v3 2/2] b43: Completely remove support for phy_a

2016-06-04 Thread Guenter Roeck
Per Michael Büsch: "All a-phy code is usused", so remove it all.

Cc: Michael Büsch 
Signed-off-by: Guenter Roeck 
---
v3: no change
v2: added patch

 drivers/net/wireless/broadcom/b43/main.c |  31 +---
 drivers/net/wireless/broadcom/b43/wa.c   | 283 +++
 drivers/net/wireless/broadcom/b43/xmit.c |  17 +-
 3 files changed, 24 insertions(+), 307 deletions(-)

diff --git a/drivers/net/wireless/broadcom/b43/main.c 
b/drivers/net/wireless/broadcom/b43/main.c
index 4ee5c5853f9f..6e5d9095b195 100644
--- a/drivers/net/wireless/broadcom/b43/main.c
+++ b/drivers/net/wireless/broadcom/b43/main.c
@@ -3180,7 +3180,6 @@ static void b43_rate_memory_write(struct b43_wldev *dev, 
u16 rate, int is_ofdm)
 static void b43_rate_memory_init(struct b43_wldev *dev)
 {
switch (dev->phy.type) {
-   case B43_PHYTYPE_A:
case B43_PHYTYPE_G:
case B43_PHYTYPE_N:
case B43_PHYTYPE_LP:
@@ -3194,8 +3193,6 @@ static void b43_rate_memory_init(struct b43_wldev *dev)
b43_rate_memory_write(dev, B43_OFDM_RATE_36MB, 1);
b43_rate_memory_write(dev, B43_OFDM_RATE_48MB, 1);
b43_rate_memory_write(dev, B43_OFDM_RATE_54MB, 1);
-   if (dev->phy.type == B43_PHYTYPE_A)
-   break;
/* fallthrough */
case B43_PHYTYPE_B:
b43_rate_memory_write(dev, B43_CCK_RATE_1MB, 0);
@@ -4604,14 +4601,6 @@ static int b43_phy_versioning(struct b43_wldev *dev)
if (radio_manuf != 0x17F /* Broadcom */)
unsupported = 1;
switch (phy_type) {
-   case B43_PHYTYPE_A:
-   if (radio_id != 0x2060)
-   unsupported = 1;
-   if (radio_rev != 1)
-   unsupported = 1;
-   if (radio_manuf != 0x17F)
-   unsupported = 1;
-   break;
case B43_PHYTYPE_B:
if ((radio_id & 0xFFF0) != 0x2050)
unsupported = 1;
@@ -4766,10 +4755,7 @@ static void b43_set_synth_pu_delay(struct b43_wldev 
*dev, bool idle)
u16 pu_delay;
 
/* The time value is in microseconds. */
-   if (dev->phy.type == B43_PHYTYPE_A)
-   pu_delay = 3700;
-   else
-   pu_delay = 1050;
+   pu_delay = 1050;
if (b43_is_mode(dev->wl, NL80211_IFTYPE_ADHOC) || idle)
pu_delay = 500;
if ((dev->phy.radio_ver == 0x2050) && (dev->phy.radio_rev == 8))
@@ -4784,14 +4770,10 @@ static void b43_set_pretbtt(struct b43_wldev *dev)
u16 pretbtt;
 
/* The time value is in microseconds. */
-   if (b43_is_mode(dev->wl, NL80211_IFTYPE_ADHOC)) {
+   if (b43_is_mode(dev->wl, NL80211_IFTYPE_ADHOC))
pretbtt = 2;
-   } else {
-   if (dev->phy.type == B43_PHYTYPE_A)
-   pretbtt = 120;
-   else
-   pretbtt = 250;
-   }
+   else
+   pretbtt = 250;
b43_shm_write16(dev, B43_SHM_SHARED, B43_SHM_SH_PRETBTT, pretbtt);
b43_write16(dev, B43_MMIO_TSF_CFP_PRETBTT, pretbtt);
 }
@@ -5380,10 +5362,6 @@ static void b43_supported_bands(struct b43_wldev *dev, 
bool *have_2ghz_phy,
 
/* As a fallback, try to guess using PHY type */
switch (dev->phy.type) {
-   case B43_PHYTYPE_A:
-   *have_2ghz_phy = false;
-   *have_5ghz_phy = true;
-   return;
case B43_PHYTYPE_G:
case B43_PHYTYPE_N:
case B43_PHYTYPE_LP:
@@ -5455,7 +5433,6 @@ static int b43_wireless_core_attach(struct b43_wldev *dev)
/* We don't support 5 GHz on some PHYs yet */
if (have_5ghz_phy) {
switch (dev->phy.type) {
-   case B43_PHYTYPE_A:
case B43_PHYTYPE_G:
case B43_PHYTYPE_LP:
case B43_PHYTYPE_HT:
diff --git a/drivers/net/wireless/broadcom/b43/wa.c 
b/drivers/net/wireless/broadcom/b43/wa.c
index c218c08fb2f5..0e96c08d1e17 100644
--- a/drivers/net/wireless/broadcom/b43/wa.c
+++ b/drivers/net/wireless/broadcom/b43/wa.c
@@ -30,33 +30,6 @@
 #include "phy_common.h"
 #include "wa.h"
 
-static void b43_wa_papd(struct b43_wldev *dev)
-{
-   u16 backup;
-
-   backup = b43_ofdmtab_read16(dev, B43_OFDMTAB_PWRDYN2, 0);
-   b43_ofdmtab_write16(dev, B43_OFDMTAB_PWRDYN2, 0, 7);
-   b43_ofdmtab_write16(dev, B43_OFDMTAB_UNKNOWN_APHY, 0, 0);
-   b43_dummy_transmission(dev, true, true);
-   b43_ofdmtab_write16(dev, B43_OFDMTAB_PWRDYN2, 0, backup);
-}
-
-static void b43_wa_auxclipthr(struct b43_wldev *dev)
-{
-   b43_phy_write(dev, B43_PHY_OFDM(0x8E), 0x3800);
-}
-
-static void b43_wa_afcdac(struct b43_wldev *dev)
-{
-   b43_phy_write(dev, 0x0035, 0x03FF);
-   b43_phy_write(dev, 0x0036, 0x0400);
-}
-
-static void b43_wa_txdc_offset(struct b43_wldev *dev)
-{
-   

[PATCH v3 1/2] b43: Remove unused phy_a code

2016-06-04 Thread Guenter Roeck
gcc-6 reports the following error with -Werror=unused-const-variable.

drivers/net/wireless/broadcom/b43/phy_a.c:576:40: error:
'b43_phyops_a' defined but not used

Per Michael Büsch: "All a-phy code is usused", so remove it all,
and move the remaining Type-G initialization code into phy_g.c.

Reported-by: Fengguang Wu  [0-day test robot]
Cc: Michael Büsch 
Signed-off-by: Guenter Roeck 
---
v3: Do not rename b43_phy_inita()
v2: Remove phy_a.c; move left-over code into phy_g.c
Remove now unused data structure

 drivers/net/wireless/broadcom/b43/Makefile |   2 +-
 drivers/net/wireless/broadcom/b43/phy_a.c  | 595 -
 drivers/net/wireless/broadcom/b43/phy_a.h  |  22 -
 drivers/net/wireless/broadcom/b43/phy_common.h |   3 -
 drivers/net/wireless/broadcom/b43/phy_g.c  |  25 +-
 5 files changed, 21 insertions(+), 626 deletions(-)
 delete mode 100644 drivers/net/wireless/broadcom/b43/phy_a.c

diff --git a/drivers/net/wireless/broadcom/b43/Makefile 
b/drivers/net/wireless/broadcom/b43/Makefile
index ddc4df46656f..27fab958e3d5 100644
--- a/drivers/net/wireless/broadcom/b43/Makefile
+++ b/drivers/net/wireless/broadcom/b43/Makefile
@@ -1,6 +1,6 @@
 b43-y  += main.o
 b43-y  += bus.o
-b43-$(CONFIG_B43_PHY_G)+= phy_a.o phy_g.o tables.o lo.o wa.o
+b43-$(CONFIG_B43_PHY_G)+= phy_g.o tables.o lo.o wa.o
 b43-$(CONFIG_B43_PHY_N)+= tables_nphy.o
 b43-$(CONFIG_B43_PHY_N)+= radio_2055.o
 b43-$(CONFIG_B43_PHY_N)+= radio_2056.o
diff --git a/drivers/net/wireless/broadcom/b43/phy_a.c 
b/drivers/net/wireless/broadcom/b43/phy_a.c
deleted file mode 100644
index 99c036f5ecb7..
--- a/drivers/net/wireless/broadcom/b43/phy_a.c
+++ /dev/null
@@ -1,595 +0,0 @@
-/*
-
-  Broadcom B43 wireless driver
-  IEEE 802.11a PHY driver
-
-  Copyright (c) 2005 Martin Langer ,
-  Copyright (c) 2005-2007 Stefano Brivio 
-  Copyright (c) 2005-2008 Michael Buesch 
-  Copyright (c) 2005, 2006 Danny van Dyk 
-  Copyright (c) 2005, 2006 Andreas Jaggi 
-
-  This program is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; either version 2 of the License, or
-  (at your option) any later version.
-
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with this program; see the file COPYING.  If not, write to
-  the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor,
-  Boston, MA 02110-1301, USA.
-
-*/
-
-#include 
-
-#include "b43.h"
-#include "phy_a.h"
-#include "phy_common.h"
-#include "wa.h"
-#include "tables.h"
-#include "main.h"
-
-
-/* Get the freq, as it has to be written to the device. */
-static inline u16 channel2freq_a(u8 channel)
-{
-   B43_WARN_ON(channel > 200);
-
-   return (5000 + 5 * channel);
-}
-
-static inline u16 freq_r3A_value(u16 frequency)
-{
-   u16 value;
-
-   if (frequency < 5091)
-   value = 0x0040;
-   else if (frequency < 5321)
-   value = 0x;
-   else if (frequency < 5806)
-   value = 0x0080;
-   else
-   value = 0x0040;
-
-   return value;
-}
-
-#if 0
-/* This function converts a TSSI value to dBm in Q5.2 */
-static s8 b43_aphy_estimate_power_out(struct b43_wldev *dev, s8 tssi)
-{
-   struct b43_phy *phy = &dev->phy;
-   struct b43_phy_a *aphy = phy->a;
-   s8 dbm = 0;
-   s32 tmp;
-
-   tmp = (aphy->tgt_idle_tssi - aphy->cur_idle_tssi + tssi);
-   tmp += 0x80;
-   tmp = clamp_val(tmp, 0x00, 0xFF);
-   dbm = aphy->tssi2dbm[tmp];
-   //TODO: There's a FIXME on the specs
-
-   return dbm;
-}
-#endif
-
-static void b43_radio_set_tx_iq(struct b43_wldev *dev)
-{
-   static const u8 data_high[5] = { 0x00, 0x40, 0x80, 0x90, 0xD0 };
-   static const u8 data_low[5] = { 0x00, 0x01, 0x05, 0x06, 0x0A };
-   u16 tmp = b43_radio_read16(dev, 0x001E);
-   int i, j;
-
-   for (i = 0; i < 5; i++) {
-   for (j = 0; j < 5; j++) {
-   if (tmp == (data_high[i] << 4 | data_low[j])) {
-   b43_phy_write(dev, 0x0069,
- (i - j) << 8 | 0x00C0);
-   return;
-   }
-   }
-   }
-}
-
-static void aphy_channel_switch(struct b43_wldev *dev, unsigned int channel)
-{
-   u16 freq, r8, tmp;
-
-   freq = channel2freq_a(channel);
-
-   r8 = b43_

Re: [char-misc-next 2/5] watchdog: mei_wdt: use module_mei_cl_driver macro

2016-10-19 Thread Guenter Roeck

On 10/19/2016 06:33 AM, Tomas Winkler wrote:

Replace boilerplate driver registration with module_mei_cl_driver macro.

Signed-off-by: Tomas Winkler 


Acked-by: Guenter Roeck 


---
 drivers/watchdog/mei_wdt.c | 20 +---
 1 file changed, 1 insertion(+), 19 deletions(-)

diff --git a/drivers/watchdog/mei_wdt.c b/drivers/watchdog/mei_wdt.c
index 630bd189f167..116be477c8fd 100644
--- a/drivers/watchdog/mei_wdt.c
+++ b/drivers/watchdog/mei_wdt.c
@@ -699,25 +699,7 @@ static struct mei_cl_driver mei_wdt_driver = {
.remove = mei_wdt_remove,
 };

-static int __init mei_wdt_init(void)
-{
-   int ret;
-
-   ret = mei_cldev_driver_register(&mei_wdt_driver);
-   if (ret) {
-   pr_err(KBUILD_MODNAME ": module registration failed\n");
-   return ret;
-   }
-   return 0;
-}
-
-static void __exit mei_wdt_exit(void)
-{
-   mei_cldev_driver_unregister(&mei_wdt_driver);
-}
-
-module_init(mei_wdt_init);
-module_exit(mei_wdt_exit);
+module_mei_cl_driver(mei_wdt_driver);

 MODULE_AUTHOR("Intel Corporation");
 MODULE_LICENSE("GPL");





[PATCH] bcma: Add dependency on OF_ADDRESS

2014-10-09 Thread Guenter Roeck
Commit 2101e533f41a ("bcma: register bcma as device tree driver")
introduces a hard dependency on OF_ADDRESS into the bcma driver.
OF_ADDRESS is specifically disabled for the sparc architecture.
This results in the following error when building sparc64:allmodconfig.

drivers/bcma/main.c: In function 'bcma_of_find_child_device':
drivers/bcma/main.c:150:3: error: implicit declaration of function 
'of_translate_address'

Fixes: 2101e533f41a ("bcma: register bcma as device tree driver")
Cc: Hauke Mehrtens 
Cc: Arnd Bergmann 
Signed-off-by: Guenter Roeck 
---
 drivers/bcma/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/bcma/Kconfig b/drivers/bcma/Kconfig
index 0ee48be..ca4b420 100644
--- a/drivers/bcma/Kconfig
+++ b/drivers/bcma/Kconfig
@@ -1,6 +1,6 @@
 config BCMA_POSSIBLE
bool
-   depends on HAS_IOMEM && HAS_DMA
+   depends on HAS_IOMEM && HAS_DMA && OF_ADDRESS
default y
 
 menu "Broadcom specific AMBA"
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] bcma: Add dependency on OF_ADDRESS

2014-10-09 Thread Guenter Roeck
On Thu, Oct 09, 2014 at 06:54:48PM +0200, Rafał Miłecki wrote:
> On 9 October 2014 18:41, Guenter Roeck  wrote:
> > Commit 2101e533f41a ("bcma: register bcma as device tree driver")
> > introduces a hard dependency on OF_ADDRESS into the bcma driver.
> > OF_ADDRESS is specifically disabled for the sparc architecture.
> > This results in the following error when building sparc64:allmodconfig.
> 
> Won't this make bcma im-POSSIBLE on MIPS? And maybe x86(_64), or at
> least add an unneeded dependency? I think we should somehow limit this
> to BCM5301X arch.

sparc, not mips.

Something like "depends on !OF || OF_ADDRESS" would limit the impact to
sparc, and only if OF is configured as well. I'll update accordingly
and resubmit. Everything else would have to be done in the driver itself,
which I rather not touch myself.

Guenter
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2] bcma: Add dependency on OF_ADDRESS

2014-10-09 Thread Guenter Roeck
Commit 2101e533f41a ("bcma: register bcma as device tree driver")
introduces a hard dependency on OF_ADDRESS into the bcma driver.
OF_ADDRESS is specifically disabled for the sparc architecture.
This results in the following error when building sparc64:allmodconfig.

drivers/bcma/main.c: In function 'bcma_of_find_child_device':
drivers/bcma/main.c:150:3: error: implicit declaration of function 
'of_translate_address'

Only build the bcma driver if OF is not configured or if both
OF and OF_ADDRESS are configured to solve the problem.

Fixes: 2101e533f41a ("bcma: register bcma as device tree driver")
Cc: Hauke Mehrtens 
Cc: Arnd Bergmann 
Signed-off-by: Guenter Roeck 
---
v2: Limit additional dependency to '!OF || OF_ADDRESS'. 

 drivers/bcma/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/bcma/Kconfig b/drivers/bcma/Kconfig
index 0ee48be..e240ef0 100644
--- a/drivers/bcma/Kconfig
+++ b/drivers/bcma/Kconfig
@@ -1,6 +1,6 @@
 config BCMA_POSSIBLE
bool
-   depends on HAS_IOMEM && HAS_DMA
+   depends on HAS_IOMEM && HAS_DMA && (!OF || OF_ADDRESS)
default y
 
 menu "Broadcom specific AMBA"
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] bcma: Add dependency on OF_ADDRESS

2014-10-09 Thread Guenter Roeck
On Thu, Oct 09, 2014 at 07:15:32PM +0200, Arend van Spriel wrote:
> On 10/09/14 18:54, Rafał Miłecki wrote:
> >On 9 October 2014 18:41, Guenter Roeck  wrote:
> >>Commit 2101e533f41a ("bcma: register bcma as device tree driver")
> >>introduces a hard dependency on OF_ADDRESS into the bcma driver.
> >>OF_ADDRESS is specifically disabled for the sparc architecture.
> >>This results in the following error when building sparc64:allmodconfig.
> 
> Does this mean on sparc (using allmodconfig) you will get CONFIG_OF
> and !CONFIG_OF_ADDRESS? Does that makes sense?
> 

You tell me. From drivers/of/Kconfig:

config OF_ADDRESS
def_bool y
depends on !SPARC
select OF_ADDRESS_PCI if PCI

Presumably there is a reason to disable OF_ADDRESS for sparc.

> btw. the OF_ADDRESS dependency was introduced by commit "bcma: get
> IRQ numbers from dt".
> 
Ah, sorry. Ok, I'll send v3 after taking a break (and waiting
for additional comments).

Guenter
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] bcma: Add dependency on OF_ADDRESS

2014-10-09 Thread Guenter Roeck
On Thu, Oct 09, 2014 at 07:15:32PM +0200, Arend van Spriel wrote:
> On 10/09/14 18:54, Rafał Miłecki wrote:
> >On 9 October 2014 18:41, Guenter Roeck  wrote:
> >>Commit 2101e533f41a ("bcma: register bcma as device tree driver")
> >>introduces a hard dependency on OF_ADDRESS into the bcma driver.
> >>OF_ADDRESS is specifically disabled for the sparc architecture.
> >>This results in the following error when building sparc64:allmodconfig.
> 
> Does this mean on sparc (using allmodconfig) you will get CONFIG_OF
> and !CONFIG_OF_ADDRESS? Does that makes sense?
> 
> btw. the OF_ADDRESS dependency was introduced by commit "bcma: get
> IRQ numbers from dt".

Looking into the code again: Really ? git blame tells me otherwise.
Also, I don't see the commit you refer to in the upstream kernel.
Maybe I am missing something.

Guenter
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] bcma: Add dependency on OF_ADDRESS

2014-10-09 Thread Guenter Roeck
On Thu, Oct 09, 2014 at 07:18:31PM +0200, Arend van Spriel wrote:
> On 10/09/14 19:15, Arend van Spriel wrote:
> >On 10/09/14 18:54, Rafał Miłecki wrote:
> >>On 9 October 2014 18:41, Guenter Roeck wrote:
> >>>Commit 2101e533f41a ("bcma: register bcma as device tree driver")
> >>>introduces a hard dependency on OF_ADDRESS into the bcma driver.
> >>>OF_ADDRESS is specifically disabled for the sparc architecture.
> >>>This results in the following error when building sparc64:allmodconfig.
> >
> >Does this mean on sparc (using allmodconfig) you will get CONFIG_OF and
> >!CONFIG_OF_ADDRESS? Does that makes sense?
> 
> Is CONFIG_OF is used on sparc to access OpenBoot information?
> 
I have no idea. All I know is that the driver doesn't build anymore with OF
enabled and OF_ADDRESS disabled.

Guenter
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] bcma: Add dependency on OF_ADDRESS

2014-10-09 Thread Guenter Roeck
On Thu, Oct 09, 2014 at 08:28:31PM +0200, Hauke Mehrtens wrote:
> On 10/09/2014 07:29 PM, Guenter Roeck wrote:
> > On Thu, Oct 09, 2014 at 07:18:31PM +0200, Arend van Spriel wrote:
> >> On 10/09/14 19:15, Arend van Spriel wrote:
> >>> On 10/09/14 18:54, Rafał Miłecki wrote:
> >>>> On 9 October 2014 18:41, Guenter Roeck wrote:
> >>>>> Commit 2101e533f41a ("bcma: register bcma as device tree driver")
> >>>>> introduces a hard dependency on OF_ADDRESS into the bcma driver.
> >>>>> OF_ADDRESS is specifically disabled for the sparc architecture.
> >>>>> This results in the following error when building sparc64:allmodconfig.
> >>>
> >>> Does this mean on sparc (using allmodconfig) you will get CONFIG_OF and
> >>> !CONFIG_OF_ADDRESS? Does that makes sense?
> >>
> >> Is CONFIG_OF is used on sparc to access OpenBoot information?
> >>
> > I have no idea. All I know is that the driver doesn't build anymore with OF
> > enabled and OF_ADDRESS disabled.
> 
> Device tree support in bcma is only needed on some SoC, when this is
> used on a PCIe card it is not needed.
> 
> I would just deactivate the parts that are using device tree in bcma
> when it is not available. I will send a patch after having something to eat.
> 
Devicetree dependency is already covered with #ifdef CONFIG_OF. Problem is
that it really needs #ifdef CONFIG_OF_ADDRESS. Though even that might be
better than my patch, since it would at least build the driver on sparc
as it used to do.

> Is there a better method which is compatible with SPARC than using
> of_translate_address() to get the reg address and also take the ranges
> attribute of the bus into account?
> 
No idea, sorry. Can you by any chance use pcie device information
instead of depending on devicetree data ?

Guenter
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] bcma: fix build when CONFIG_OF_ADDRESS is not set

2014-10-09 Thread Guenter Roeck
On Thu, Oct 09, 2014 at 11:39:41PM +0200, Hauke Mehrtens wrote:
> Commit 2101e533f41a ("bcma: register bcma as device tree driver")
> introduces a hard dependency on OF_ADDRESS into the bcma driver.
> OF_ADDRESS is specifically disabled for the sparc architecture.
> This results in the following error when building sparc64:allmodconfig.
> 
> drivers/bcma/main.c: In function 'bcma_of_find_child_device':
> drivers/bcma/main.c:150:3: error: implicit declaration of function 
> 'of_translate_address'
> 
> Fixes: 2101e533f41a ("bcma: register bcma as device tree driver")
> Reported-by: Guenter Roeck 
> Signed-off-by: Hauke Mehrtens 

Much better than my patch.

Reviewed-by: Guenter Roeck 

Also compile tested to make sure it fixes the build problem.

Guenter

> ---
>  drivers/bcma/main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c
> index d1656c2..1000955 100644
> --- a/drivers/bcma/main.c
> +++ b/drivers/bcma/main.c
> @@ -132,7 +132,7 @@ static bool bcma_is_core_needed_early(u16 core_id)
>   return false;
>  }
>  
> -#ifdef CONFIG_OF
> +#if defined(CONFIG_OF) && defined(CONFIG_OF_ADDRESS)
>  static struct device_node *bcma_of_find_child_device(struct platform_device 
> *parent,
>struct bcma_device *core)
>  {
> -- 
> 1.9.1
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] bcma: Add dependency on OF_ADDRESS

2014-10-09 Thread Guenter Roeck
On Thu, Oct 09, 2014 at 11:48:08PM +0200, Hauke Mehrtens wrote:
> On 10/09/2014 09:25 PM, Guenter Roeck wrote:
> > On Thu, Oct 09, 2014 at 08:28:31PM +0200, Hauke Mehrtens wrote:
> >> On 10/09/2014 07:29 PM, Guenter Roeck wrote:
> >>> On Thu, Oct 09, 2014 at 07:18:31PM +0200, Arend van Spriel wrote:
> >>>> On 10/09/14 19:15, Arend van Spriel wrote:
> >>>>> On 10/09/14 18:54, Rafał Miłecki wrote:
> >>>>>> On 9 October 2014 18:41, Guenter Roeck wrote:
> >>>>>>> Commit 2101e533f41a ("bcma: register bcma as device tree driver")
> >>>>>>> introduces a hard dependency on OF_ADDRESS into the bcma driver.
> >>>>>>> OF_ADDRESS is specifically disabled for the sparc architecture.
> >>>>>>> This results in the following error when building 
> >>>>>>> sparc64:allmodconfig.
> >>>>>
> >>>>> Does this mean on sparc (using allmodconfig) you will get CONFIG_OF and
> >>>>> !CONFIG_OF_ADDRESS? Does that makes sense?
> >>>>
> >>>> Is CONFIG_OF is used on sparc to access OpenBoot information?
> >>>>
> >>> I have no idea. All I know is that the driver doesn't build anymore with 
> >>> OF
> >>> enabled and OF_ADDRESS disabled.
> >>
> >> Device tree support in bcma is only needed on some SoC, when this is
> >> used on a PCIe card it is not needed.
> >>
> >> I would just deactivate the parts that are using device tree in bcma
> >> when it is not available. I will send a patch after having something to 
> >> eat.
> >>
> > Devicetree dependency is already covered with #ifdef CONFIG_OF. Problem is
> > that it really needs #ifdef CONFIG_OF_ADDRESS. Though even that might be
> > better than my patch, since it would at least build the driver on sparc
> > as it used to do.
> > 
> >> Is there a better method which is compatible with SPARC than using
> >> of_translate_address() to get the reg address and also take the ranges
> >> attribute of the bus into account?
> >>
> > No idea, sorry. Can you by any chance use pcie device information
> > instead of depending on devicetree data ?
> 
> Device tree is not used for PCIe devices in bcma. We only use it when
> bcma is used for the system bus on some Broadcom SoCs, currently there
> is no plan to use device tree for PCIe devices in bcma. I think bcma is
> only used on wifi cards connected via PCIe on Sparc systems.
> 
Ok. Well, with your patch the code is as good or as bad as it was prior to
adding devicetree support to the driver, so hopefully should work.

Guenter
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] bcma: fix build when CONFIG_OF_ADDRESS is not set

2014-10-25 Thread Guenter Roeck
On Thu, Oct 09, 2014 at 11:39:41PM +0200, Hauke Mehrtens wrote:
> Commit 2101e533f41a ("bcma: register bcma as device tree driver")
> introduces a hard dependency on OF_ADDRESS into the bcma driver.
> OF_ADDRESS is specifically disabled for the sparc architecture.
> This results in the following error when building sparc64:allmodconfig.
> 
> drivers/bcma/main.c: In function 'bcma_of_find_child_device':
> drivers/bcma/main.c:150:3: error: implicit declaration of function 
> 'of_translate_address'
> 
> Fixes: 2101e533f41a ("bcma: register bcma as device tree driver")
> Reported-by: Guenter Roeck 
> Signed-off-by: Hauke Mehrtens 

The upstream kernel still does not include this patch, and the sparc64 build
is still broken.

Is this patch on its way upstream ?

Guenter

> ---
>  drivers/bcma/main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c
> index d1656c2..1000955 100644
> --- a/drivers/bcma/main.c
> +++ b/drivers/bcma/main.c
> @@ -132,7 +132,7 @@ static bool bcma_is_core_needed_early(u16 core_id)
>   return false;
>  }
>  
> -#ifdef CONFIG_OF
> +#if defined(CONFIG_OF) && defined(CONFIG_OF_ADDRESS)
>  static struct device_node *bcma_of_find_child_device(struct platform_device 
> *parent,
>struct bcma_device *core)
>  {
> -- 
> 1.9.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] bcma: fix build when CONFIG_OF_ADDRESS is not set

2014-10-27 Thread Guenter Roeck
On Mon, Oct 27, 2014 at 11:15:09AM -0400, John W. Linville wrote:
> Yes, I have it queued.  Things have been delayed due to my recent
> travels, etc.
> 
Thanks!

Guenter

> On Sat, Oct 25, 2014 at 01:36:53PM -0700, Guenter Roeck wrote:
> > On Thu, Oct 09, 2014 at 11:39:41PM +0200, Hauke Mehrtens wrote:
> > > Commit 2101e533f41a ("bcma: register bcma as device tree driver")
> > > introduces a hard dependency on OF_ADDRESS into the bcma driver.
> > > OF_ADDRESS is specifically disabled for the sparc architecture.
> > > This results in the following error when building sparc64:allmodconfig.
> > > 
> > > drivers/bcma/main.c: In function 'bcma_of_find_child_device':
> > > drivers/bcma/main.c:150:3: error: implicit declaration of function 
> > > 'of_translate_address'
> > > 
> > > Fixes: 2101e533f41a ("bcma: register bcma as device tree driver")
> > > Reported-by: Guenter Roeck 
> > > Signed-off-by: Hauke Mehrtens 
> > 
> > The upstream kernel still does not include this patch, and the sparc64 build
> > is still broken.
> > 
> > Is this patch on its way upstream ?
> > 
> > Guenter
> > 
> > > ---
> > >  drivers/bcma/main.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c
> > > index d1656c2..1000955 100644
> > > --- a/drivers/bcma/main.c
> > > +++ b/drivers/bcma/main.c
> > > @@ -132,7 +132,7 @@ static bool bcma_is_core_needed_early(u16 core_id)
> > >   return false;
> > >  }
> > >  
> > > -#ifdef CONFIG_OF
> > > +#if defined(CONFIG_OF) && defined(CONFIG_OF_ADDRESS)
> > >  static struct device_node *bcma_of_find_child_device(struct 
> > > platform_device *parent,
> > >struct bcma_device *core)
> > >  {
> > > -- 
> > > 1.9.1
> > > 
> > > --
> > > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> > > the body of a message to majord...@vger.kernel.org
> > > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> > > Please read the FAQ at  http://www.tux.org/lkml/
> > > 
> > > 
> > 
> 
> -- 
> John W. Linville  Someday the world will need a hero, and you
> linvi...@tuxdriver.commight be all we have.  Be ready.
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH -next] staging: wilc1000: Include linux/gpio.h instead of asm/gpio.h

2015-05-27 Thread Guenter Roeck
Fix:

drivers/staging/wilc1000/linux_wlan.c:18:22: fatal error:
asm/gpio.h: No such file or directory

Not every architecture has asm/gpio.h. Include linux/gpio.h instead.

Signed-off-by: Guenter Roeck 
---
 drivers/staging/wilc1000/linux_wlan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index 49b238a05a88..18f1bd00201a 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -15,7 +15,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 #include 
 #include 
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] staging: wilc1000: Disable for S390

2015-05-27 Thread Guenter Roeck
The wilc1000 driver uses definitions such as DEBUG_LEVEL, DEBUG,
and PRINT_INFO. This causes compile errors on S390 which has similar
definitions in its core code. Disable the driver for S390 instead
of giving the non-standard messaging code credit by trying to fix it.

Signed-off-by: Guenter Roeck 
---
 drivers/staging/wilc1000/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/wilc1000/Kconfig b/drivers/staging/wilc1000/Kconfig
index 101f908bc9ed..0b349d3c1475 100644
--- a/drivers/staging/wilc1000/Kconfig
+++ b/drivers/staging/wilc1000/Kconfig
@@ -1,5 +1,6 @@
 config WILC1000
tristate "WILC1000 support (WiFi only)"
+   depends on !S390
---help---
This module only support IEEE 802.11n WiFi.
 
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] NFC: nxp-nci: Include unaligned.h instead of access_ok.h

2015-08-01 Thread Guenter Roeck
Directly including access_ok.h can result in the following compile errors
if an architecture such as ia64 does not support direct unaligned accesses.

include/linux/unaligned/access_ok.h:7:19: error:
redefinition of 'get_unaligned_le16'
include/linux/unaligned/le_struct.h:6:19: note:
previous definition of 'get_unaligned_le16' was here
include/linux/unaligned/access_ok.h:12:19: error:
redefinition of 'get_unaligned_le32'
include/linux/unaligned/le_struct.h:11:19: note:
previous definition of 'get_unaligned_le32' was here

Include asm/unaligned.h instead and let the architecture decide which
access functions to use.

Cc: Clément Perrochaud 
Cc: Samuel Ortiz 
Signed-off-by: Guenter Roeck 
---
 drivers/nfc/nxp-nci/firmware.c | 2 +-
 drivers/nfc/nxp-nci/i2c.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/nfc/nxp-nci/firmware.c b/drivers/nfc/nxp-nci/firmware.c
index 5291797324ba..553011f58339 100644
--- a/drivers/nfc/nxp-nci/firmware.c
+++ b/drivers/nfc/nxp-nci/firmware.c
@@ -24,7 +24,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 #include "nxp-nci.h"
 
diff --git a/drivers/nfc/nxp-nci/i2c.c b/drivers/nfc/nxp-nci/i2c.c
index 2f77f1d03638..5907e7a727a1 100644
--- a/drivers/nfc/nxp-nci/i2c.c
+++ b/drivers/nfc/nxp-nci/i2c.c
@@ -36,7 +36,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 #include 
 
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 00/27] kill devm_ioremap_nocache

2017-12-23 Thread Guenter Roeck

On 12/23/2017 05:48 AM, Greg KH wrote:

On Sat, Dec 23, 2017 at 06:55:25PM +0800, Yisheng Xie wrote:

Hi all,

When I tried to use devm_ioremap function and review related code, I found
devm_ioremap and devm_ioremap_nocache is almost the same with each other,
except one use ioremap while the other use ioremap_nocache.


For all arches?  Really?  Look at MIPS, and x86, they have different
functions.



Both mips and x86 end up mapping the same function, but other arches don't.
mn10300 is one where ioremap and ioremap_nocache are definitely different.

Guenter


While ioremap's
default function is ioremap_nocache, so devm_ioremap_nocache also have the
same function with devm_ioremap, which can just be killed to reduce the size
of devres.o(from 20304 bytes to 18992 bytes in my compile environment).

I have posted two versions, which use macro instead of function for
devm_ioremap_nocache[1] or devm_ioremap[2]. And Greg suggest me to kill
devm_ioremap_nocache for no need to keep a macro around for the duplicate
thing. So here comes v3 and please help to review.


I don't think this can be done, what am I missing?  These functions are
not identical, sorry for missing that before.

thanks,

greg k-h





[PATCH] bcma: Fix 'allmodconfig' and BCMA builds on MIPS targets

2018-01-14 Thread Guenter Roeck
Mips builds with BCMA host mode enabled fail in mainline and -next
with:

In file included from include/linux/bcma/bcma.h:10:0,
 from drivers/bcma/bcma_private.h:9,
 from drivers/bcma/main.c:8:
include/linux/bcma/bcma_driver_pci.h:218:24: error:
field 'pci_controller' has incomplete type

Bisect points to commit d41e6858ba58c ("MIPS: Kconfig: Set default MIPS
system type as generic") as the culprit. Analysis shows that the commmit
changes PCI configuration and enables PCI_DRIVERS_GENERIC. This in turn
disables PCI_DRIVERS_LEGACY. 'struct pci_controller' is, however, only
defined if PCI_DRIVERS_LEGACY is enabled.

Ultimately that means that BCMA_DRIVER_PCI_HOSTMODE depends on
PCI_DRIVERS_LEGACY. Add the missing dependency.

Fixes: d41e6858ba58c ("MIPS: Kconfig: Set default MIPS system type as ...")
Cc: Matt Redfearn 
Cc: James Hogan 
Signed-off-by: Guenter Roeck 
---
I am aware that this problem has been reported several times. I have
not been able to find a fix, but I may have missed it. If so, my
apologies for the noise.

Also note that this is not the only fix required; commit d41e6858ba58c,
as simple as it looks like, does a pretty good job messing up
"mips:allmodconfig" builds.

 drivers/bcma/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/bcma/Kconfig b/drivers/bcma/Kconfig
index 02d78f6cecbb..ba8acca036df 100644
--- a/drivers/bcma/Kconfig
+++ b/drivers/bcma/Kconfig
@@ -55,7 +55,7 @@ config BCMA_DRIVER_PCI
 
 config BCMA_DRIVER_PCI_HOSTMODE
bool "Driver for PCI core working in hostmode"
-   depends on MIPS && BCMA_DRIVER_PCI
+   depends on MIPS && BCMA_DRIVER_PCI && PCI_DRIVERS_LEGACY
help
  PCI core hostmode operation (external PCI bus).
 
-- 
2.7.4



Re: [PATCH] bcma: Fix 'allmodconfig' and BCMA builds on MIPS targets

2018-01-14 Thread Guenter Roeck

[ copying linux-mips ]

On 01/14/2018 01:34 PM, Guenter Roeck wrote:

Mips builds with BCMA host mode enabled fail in mainline and -next
with:

In file included from include/linux/bcma/bcma.h:10:0,
  from drivers/bcma/bcma_private.h:9,
 from drivers/bcma/main.c:8:
include/linux/bcma/bcma_driver_pci.h:218:24: error:
field 'pci_controller' has incomplete type

Bisect points to commit d41e6858ba58c ("MIPS: Kconfig: Set default MIPS
system type as generic") as the culprit. Analysis shows that the commmit
changes PCI configuration and enables PCI_DRIVERS_GENERIC. This in turn
disables PCI_DRIVERS_LEGACY. 'struct pci_controller' is, however, only
defined if PCI_DRIVERS_LEGACY is enabled.

Ultimately that means that BCMA_DRIVER_PCI_HOSTMODE depends on
PCI_DRIVERS_LEGACY. Add the missing dependency.

Fixes: d41e6858ba58c ("MIPS: Kconfig: Set default MIPS system type as ...")
Cc: Matt Redfearn 
Cc: James Hogan 
Signed-off-by: Guenter Roeck 
---
I am aware that this problem has been reported several times. I have
not been able to find a fix, but I may have missed it. If so, my
apologies for the noise.


I should have said "I have not been able to find a patch fixing it".


Also note that this is not the only fix required; commit d41e6858ba58c,
as simple as it looks like, does a pretty good job messing up
"mips:allmodconfig" builds.


... nor did I find patch(es) fixing the other build problem(s) introduced
by d41e6858ba58c.

Guenter


  drivers/bcma/Kconfig | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/bcma/Kconfig b/drivers/bcma/Kconfig
index 02d78f6cecbb..ba8acca036df 100644
--- a/drivers/bcma/Kconfig
+++ b/drivers/bcma/Kconfig
@@ -55,7 +55,7 @@ config BCMA_DRIVER_PCI
  
  config BCMA_DRIVER_PCI_HOSTMODE

bool "Driver for PCI core working in hostmode"
-   depends on MIPS && BCMA_DRIVER_PCI
+   depends on MIPS && BCMA_DRIVER_PCI && PCI_DRIVERS_LEGACY
help
  PCI core hostmode operation (external PCI bus).
  





Re: [PATCH] bcma: Fix 'allmodconfig' and BCMA builds on MIPS targets

2018-01-15 Thread Guenter Roeck

On 01/15/2018 09:10 AM, Paul Burton wrote:

Hello,

On Mon, Jan 15, 2018 at 10:23:37AM +, James Hogan wrote:

On Sun, Jan 14, 2018 at 01:34:02PM -0800, Guenter Roeck wrote:

Mips builds with BCMA host mode enabled fail in mainline and -next
with:

In file included from include/linux/bcma/bcma.h:10:0,
  from drivers/bcma/bcma_private.h:9,
 from drivers/bcma/main.c:8:
include/linux/bcma/bcma_driver_pci.h:218:24: error:
field 'pci_controller' has incomplete type

Bisect points to commit d41e6858ba58c ("MIPS: Kconfig: Set default MIPS
system type as generic") as the culprit. Analysis shows that the commmit
changes PCI configuration and enables PCI_DRIVERS_GENERIC. This in turn
disables PCI_DRIVERS_LEGACY. 'struct pci_controller' is, however, only
defined if PCI_DRIVERS_LEGACY is enabled.

Ultimately that means that BCMA_DRIVER_PCI_HOSTMODE depends on
PCI_DRIVERS_LEGACY. Add the missing dependency.

Fixes: d41e6858ba58c ("MIPS: Kconfig: Set default MIPS system type as ...")


Well, technically I think commit c5611df96804 ("MIPS: PCI: Introduce
CONFIG_PCI_DRIVERS_LEGACY") is to blame (Cc'ing paul), and the first bad
commit would be commit eed0eabd12ef ("MIPS: generic: Introduce generic
DT-based board support") which selects PCI_DRIVERS_GENERIC and is the
only platform to do so. Both commits were first in v4.9-rc1 and I can
reproduce this problem at that latter commit with the appropriate
configuration.


Ah - yes if I recall correctly my assumption was that the MIPS-specific
struct pci_controller was only used by the MIPS-specific PCI drivers
under arch/mips/pci/, which are only built when configured for the
appropriate platform.

In this case use of that MIPS-specific struct pci_controller has spread
beyond arch/mips/ & the user can be configured in for platforms other
than the one that will actually use the driver, including the generic
platform which moves towards more generic PCI drivers in
drivers/pci/host/.


But yes clearly the mentioned commit does also expose that existing
problem more widely and to the default allmodconfig, and it looks like a
reasonable approach for now, so if some mention of the other two commits
is added:

Reviewed-by: James Hogan 


Likewise, with the "Fixes:" tag fixed:

 Reviewed-by: Paul Burton 



Unfortunately, that alone doesn't fix the problem. SSB driver dependencies
are also broken, and in much worse shape. I had to add dependencies in five
places to get it to build, and the result is so messy that I won't even try
to submit it. And if that is fixed, mips:allmodconfig still doesn't build -
the next error is an undefined reference to physical_memsize in
arch/mips/kernel/vpe-mt.o.

I wonder if I should just stop trying to build allmodconfig for mips.
Any thoughts ?

Guenter


Thanks,
 Paul


Having it in 4.15 would be great.

Cheers
James


Cc: Matt Redfearn 
Cc: James Hogan 
Signed-off-by: Guenter Roeck 
---
I am aware that this problem has been reported several times. I have
not been able to find a fix, but I may have missed it. If so, my
apologies for the noise.

Also note that this is not the only fix required; commit d41e6858ba58c,
as simple as it looks like, does a pretty good job messing up
"mips:allmodconfig" builds.

  drivers/bcma/Kconfig | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/bcma/Kconfig b/drivers/bcma/Kconfig
index 02d78f6cecbb..ba8acca036df 100644
--- a/drivers/bcma/Kconfig
+++ b/drivers/bcma/Kconfig
@@ -55,7 +55,7 @@ config BCMA_DRIVER_PCI
  
  config BCMA_DRIVER_PCI_HOSTMODE

bool "Driver for PCI core working in hostmode"
-   depends on MIPS && BCMA_DRIVER_PCI
+   depends on MIPS && BCMA_DRIVER_PCI && PCI_DRIVERS_LEGACY
help
  PCI core hostmode operation (external PCI bus).
  
--

2.7.4









Re: [PATCH] bcma: Fix 'allmodconfig' and BCMA builds on MIPS targets

2018-01-15 Thread Guenter Roeck

On 01/15/2018 12:30 PM, James Hogan wrote:

On Mon, Jan 15, 2018 at 12:05:48PM -0800, Guenter Roeck wrote:

On 01/15/2018 09:10 AM, Paul Burton wrote:

Hello,

On Mon, Jan 15, 2018 at 10:23:37AM +, James Hogan wrote:

On Sun, Jan 14, 2018 at 01:34:02PM -0800, Guenter Roeck wrote:

Mips builds with BCMA host mode enabled fail in mainline and -next
with:

In file included from include/linux/bcma/bcma.h:10:0,
   from drivers/bcma/bcma_private.h:9,
 from drivers/bcma/main.c:8:
include/linux/bcma/bcma_driver_pci.h:218:24: error:
field 'pci_controller' has incomplete type

Bisect points to commit d41e6858ba58c ("MIPS: Kconfig: Set default MIPS
system type as generic") as the culprit. Analysis shows that the commmit
changes PCI configuration and enables PCI_DRIVERS_GENERIC. This in turn
disables PCI_DRIVERS_LEGACY. 'struct pci_controller' is, however, only
defined if PCI_DRIVERS_LEGACY is enabled.

Ultimately that means that BCMA_DRIVER_PCI_HOSTMODE depends on
PCI_DRIVERS_LEGACY. Add the missing dependency.

Fixes: d41e6858ba58c ("MIPS: Kconfig: Set default MIPS system type as ...")


Well, technically I think commit c5611df96804 ("MIPS: PCI: Introduce
CONFIG_PCI_DRIVERS_LEGACY") is to blame (Cc'ing paul), and the first bad
commit would be commit eed0eabd12ef ("MIPS: generic: Introduce generic
DT-based board support") which selects PCI_DRIVERS_GENERIC and is the
only platform to do so. Both commits were first in v4.9-rc1 and I can
reproduce this problem at that latter commit with the appropriate
configuration.


Ah - yes if I recall correctly my assumption was that the MIPS-specific
struct pci_controller was only used by the MIPS-specific PCI drivers
under arch/mips/pci/, which are only built when configured for the
appropriate platform.

In this case use of that MIPS-specific struct pci_controller has spread
beyond arch/mips/ & the user can be configured in for platforms other
than the one that will actually use the driver, including the generic
platform which moves towards more generic PCI drivers in
drivers/pci/host/.


But yes clearly the mentioned commit does also expose that existing
problem more widely and to the default allmodconfig, and it looks like a
reasonable approach for now, so if some mention of the other two commits
is added:

Reviewed-by: James Hogan 


Likewise, with the "Fixes:" tag fixed:

  Reviewed-by: Paul Burton 



Unfortunately, that alone doesn't fix the problem. SSB driver dependencies
are also broken, and in much worse shape. I had to add dependencies in five
places to get it to build, and the result is so messy that I won't even try
to submit it.


Oh, thats interesting. When I tried this earlier I just added "&&
PCI_DRIVERS_LEGACY" to the SSB_PCIHOST_POSSIBLE dependencies, but I was
waiting for Paul's feedback before submitting a similar patch.



You are right, that is much more straightforward than my attempted fix,
and it works.


But that wasn't -next, it was mainline + mips fixes branch + individual
fixes:



Mine is mainline plus "MIPS: Fix CPS SMP NS16550 UART defaults"
which for some reason never made it into mainline. For the nightly builds,
I ended up modifying my buildripts to fix that up manually in the created
configuration file.


And if that is fixed, mips:allmodconfig still doesn't build -
the next error is an undefined reference to physical_memsize in
arch/mips/kernel/vpe-mt.o.


That one is fairly easy to fix properly, I'll hopefully submit something
this evening.



I wonder if I should just stop trying to build allmodconfig for mips.
Any thoughts ?


With a few fixes applied it should be buildable I think. Sorry its been
late in the cycle before we've been able to get fixes merged.


Ok, I'll wait a bit longer before giving up on it.

Thanks,
Guenter


Re: [PATCH for-4.15] ssb: Disable PCI host for PCI_DRIVERS_GENERIC

2018-01-15 Thread Guenter Roeck

On 01/15/2018 01:17 PM, James Hogan wrote:

Since commit d41e6858ba58 ("MIPS: Kconfig: Set default MIPS system type
as generic") changed the default MIPS platform to the "generic"
platform, which uses PCI_DRIVERS_GENERIC instead of PCI_DRIVERS_LEGACY,
various files in drivers/ssb/ have failed to build.

This is particularly due to the existence of struct pci_controller being
dependent on PCI_DRIVERS_LEGACY since commit c5611df96804 ("MIPS: PCI:
Introduce CONFIG_PCI_DRIVERS_LEGACY"), so add that dependency to Kconfig
to prevent these files being built for the "generic" platform including
all{yes,mod}config builds.

Fixes: c5611df96804 ("MIPS: PCI: Introduce CONFIG_PCI_DRIVERS_LEGACY")
Signed-off-by: James Hogan 
Cc: Michael Buesch 
Cc: Ralf Baechle 
Cc: Paul Burton 
Cc: Matt Redfearn 
Cc: Guenter Roeck 
Cc: linux-wireless@vger.kernel.org
Cc: linux-m...@linux-mips.org


Tested-by: Guenter Roeck 


---
  drivers/ssb/Kconfig | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ssb/Kconfig b/drivers/ssb/Kconfig
index d8e4219c2324..71c73766ee22 100644
--- a/drivers/ssb/Kconfig
+++ b/drivers/ssb/Kconfig
@@ -32,7 +32,7 @@ config SSB_BLOCKIO
  
  config SSB_PCIHOST_POSSIBLE

bool
-   depends on SSB && (PCI = y || PCI = SSB)
+   depends on SSB && (PCI = y || PCI = SSB) && PCI_DRIVERS_LEGACY
default y
  
  config SSB_PCIHOST






Re: [PATCH v2] rtlwifi: rtl8192cu: Remove variable self-assignment in rf.c

2018-02-08 Thread Guenter Roeck
On Thu, Feb 8, 2018 at 4:57 PM, Matthias Kaehlcke  wrote:
> In _rtl92c_get_txpower_writeval_by_regulatory() the variable writeVal
> is assigned to itself in an if ... else statement, apparently only to
> document that the branch condition is handled and that a previously read
> value should be returned unmodified. The self-assignment causes clang to
> raise the following warning:
>
> drivers/net/wireless/realtek/rtlwifi/rtl8192cu/rf.c:304:13:
>   error: explicitly assigning value of variable of type 'u32'
> (aka 'unsigned int') to itself [-Werror,-Wself-assign]
>   writeVal = writeVal;
>
> Delete the branch with the self-assignment.
>
> Signed-off-by: Matthias Kaehlcke 

Reviewed-by: Guenter Roeck 

> ---
> Changes in v2:
> - Delete the 'else if' branch entirely
>
>  drivers/net/wireless/realtek/rtlwifi/rtl8192cu/rf.c | 3 ---
>  1 file changed, 3 deletions(-)
>
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/rf.c 
> b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/rf.c
> index 9cff6bc4049c..cf551785eb08 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/rf.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/rf.c
> @@ -299,9 +299,6 @@ static void 
> _rtl92c_get_txpower_writeval_by_regulatory(struct ieee80211_hw *hw,
> writeVal = 0x;
> if (rtlpriv->dm.dynamic_txhighpower_lvl == TXHIGHPWRLEVEL_BT1)
> writeVal = writeVal - 0x06060606;
> -   else if (rtlpriv->dm.dynamic_txhighpower_lvl ==
> -TXHIGHPWRLEVEL_BT2)
> -   writeVal = writeVal;
> *(p_outwriteval + rf) = writeVal;
> }
>  }
> --
> 2.16.0.rc1.238.g530d649a79-goog
>


Re: [PATCH 09/13] timer: Remove users of expire and data arguments to DEFINE_TIMER

2017-10-04 Thread Guenter Roeck

On 10/04/2017 04:27 PM, Kees Cook wrote:

The expire and data arguments of DEFINE_TIMER are only used in two places
and are ignored by the code (malta-display.c only uses mod_timer(),
never add_timer(), so the preset expires value is ignored). Set both
sets of arguments to zero.

Cc: Ralf Baechle 
Cc: Wim Van Sebroeck 
Cc: Guenter Roeck 
Cc: Geert Uytterhoeven 
Cc: linux-m...@linux-mips.org
Cc: linux-watch...@vger.kernel.org
Signed-off-by: Kees Cook 


For watchdog:

Acked-by: Guenter Roeck 


---
  arch/mips/mti-malta/malta-display.c | 6 +++---
  drivers/watchdog/alim7101_wdt.c | 4 ++--
  2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/mips/mti-malta/malta-display.c 
b/arch/mips/mti-malta/malta-display.c
index d4f807191ecd..ac813158b9b8 100644
--- a/arch/mips/mti-malta/malta-display.c
+++ b/arch/mips/mti-malta/malta-display.c
@@ -36,10 +36,10 @@ void mips_display_message(const char *str)
}
  }
  
-static void scroll_display_message(unsigned long data);

-static DEFINE_TIMER(mips_scroll_timer, scroll_display_message, HZ, 0);
+static void scroll_display_message(unsigned long unused);
+static DEFINE_TIMER(mips_scroll_timer, scroll_display_message, 0, 0);
  
-static void scroll_display_message(unsigned long data)

+static void scroll_display_message(unsigned long unused)
  {
mips_display_message(&display_string[display_count++]);
if (display_count == max_display_count)
diff --git a/drivers/watchdog/alim7101_wdt.c b/drivers/watchdog/alim7101_wdt.c
index 665e0e7dfe1e..3c1f6ac68ea9 100644
--- a/drivers/watchdog/alim7101_wdt.c
+++ b/drivers/watchdog/alim7101_wdt.c
@@ -71,7 +71,7 @@ MODULE_PARM_DESC(use_gpio,
"Use the gpio watchdog (required by old cobalt boards).");
  
  static void wdt_timer_ping(unsigned long);

-static DEFINE_TIMER(timer, wdt_timer_ping, 0, 1);
+static DEFINE_TIMER(timer, wdt_timer_ping, 0, 0);
  static unsigned long next_heartbeat;
  static unsigned long wdt_is_open;
  static char wdt_expect_close;
@@ -87,7 +87,7 @@ MODULE_PARM_DESC(nowayout,
   *Whack the dog
   */
  
-static void wdt_timer_ping(unsigned long data)

+static void wdt_timer_ping(unsigned long unused)
  {
/* If we got a heartbeat pulse within the WDT_US_INTERVAL
 * we agree to ping the WDT





Re: [PATCH 10/13] timer: Remove expires and data arguments from DEFINE_TIMER

2017-10-04 Thread Guenter Roeck

On 10/04/2017 04:27 PM, Kees Cook wrote:

Drop the arguments from the macro and adjust all callers with the
following script:

   perl -pi -e 's/DEFINE_TIMER\((.*), 0, 0\);/DEFINE_TIMER($1);/g;' \
 $(git grep DEFINE_TIMER | cut -d: -f1 | sort -u | grep -v timer.h)

Signed-off-by: Kees Cook 
Acked-by: Geert Uytterhoeven  # for m68k parts


For watchdog:

Acked-by: Guenter Roeck 


---
  arch/arm/mach-ixp4xx/dsmg600-setup.c  | 2 +-
  arch/arm/mach-ixp4xx/nas100d-setup.c  | 2 +-
  arch/m68k/amiga/amisound.c| 2 +-
  arch/m68k/mac/macboing.c  | 2 +-
  arch/mips/mti-malta/malta-display.c   | 2 +-
  arch/parisc/kernel/pdc_cons.c | 2 +-
  arch/s390/mm/cmm.c| 2 +-
  drivers/atm/idt77105.c| 4 ++--
  drivers/atm/iphase.c  | 2 +-
  drivers/block/ataflop.c   | 8 
  drivers/char/dtlk.c   | 2 +-
  drivers/char/hangcheck-timer.c| 2 +-
  drivers/char/nwbutton.c   | 2 +-
  drivers/char/rtc.c| 2 +-
  drivers/input/touchscreen/s3c2410_ts.c| 2 +-
  drivers/net/cris/eth_v10.c| 6 +++---
  drivers/net/hamradio/yam.c| 2 +-
  drivers/net/wireless/atmel/at76c50x-usb.c | 2 +-
  drivers/staging/speakup/main.c| 2 +-
  drivers/staging/speakup/synth.c   | 2 +-
  drivers/tty/cyclades.c| 2 +-
  drivers/tty/isicom.c  | 2 +-
  drivers/tty/moxa.c| 2 +-
  drivers/tty/rocket.c  | 2 +-
  drivers/tty/vt/keyboard.c | 2 +-
  drivers/tty/vt/vt.c   | 2 +-
  drivers/watchdog/alim7101_wdt.c   | 2 +-
  drivers/watchdog/machzwd.c| 2 +-
  drivers/watchdog/mixcomwd.c   | 2 +-
  drivers/watchdog/sbc60xxwdt.c | 2 +-
  drivers/watchdog/sc520_wdt.c  | 2 +-
  drivers/watchdog/via_wdt.c| 2 +-
  drivers/watchdog/w83877f_wdt.c| 2 +-
  drivers/xen/grant-table.c | 2 +-
  fs/pstore/platform.c  | 2 +-
  include/linux/timer.h | 4 ++--
  kernel/irq/spurious.c | 2 +-
  lib/random32.c| 2 +-
  net/atm/mpc.c | 2 +-
  net/decnet/dn_route.c | 2 +-
  net/ipv6/ip6_flowlabel.c  | 2 +-
  net/netrom/nr_loopback.c  | 2 +-
  security/keys/gc.c| 2 +-
  sound/oss/midibuf.c   | 2 +-
  sound/oss/soundcard.c | 2 +-
  sound/oss/sys_timer.c | 2 +-
  sound/oss/uart6850.c  | 2 +-
  47 files changed, 54 insertions(+), 54 deletions(-)

diff --git a/arch/arm/mach-ixp4xx/dsmg600-setup.c 
b/arch/arm/mach-ixp4xx/dsmg600-setup.c
index b3bd0e137f6d..b3689a141ec6 100644
--- a/arch/arm/mach-ixp4xx/dsmg600-setup.c
+++ b/arch/arm/mach-ixp4xx/dsmg600-setup.c
@@ -174,7 +174,7 @@ static int power_button_countdown;
  #define PBUTTON_HOLDDOWN_COUNT 4 /* 2 secs */
  
  static void dsmg600_power_handler(unsigned long data);

-static DEFINE_TIMER(dsmg600_power_timer, dsmg600_power_handler, 0, 0);
+static DEFINE_TIMER(dsmg600_power_timer, dsmg600_power_handler);
  
  static void dsmg600_power_handler(unsigned long data)

  {
diff --git a/arch/arm/mach-ixp4xx/nas100d-setup.c 
b/arch/arm/mach-ixp4xx/nas100d-setup.c
index 4e0f762bc651..562d05f9888e 100644
--- a/arch/arm/mach-ixp4xx/nas100d-setup.c
+++ b/arch/arm/mach-ixp4xx/nas100d-setup.c
@@ -197,7 +197,7 @@ static int power_button_countdown;
  #define PBUTTON_HOLDDOWN_COUNT 4 /* 2 secs */
  
  static void nas100d_power_handler(unsigned long data);

-static DEFINE_TIMER(nas100d_power_timer, nas100d_power_handler, 0, 0);
+static DEFINE_TIMER(nas100d_power_timer, nas100d_power_handler);
  
  static void nas100d_power_handler(unsigned long data)

  {
diff --git a/arch/m68k/amiga/amisound.c b/arch/m68k/amiga/amisound.c
index 90a60d758f8b..a23f48181fd6 100644
--- a/arch/m68k/amiga/amisound.c
+++ b/arch/m68k/amiga/amisound.c
@@ -66,7 +66,7 @@ void __init amiga_init_sound(void)
  }
  
  static void nosound( unsigned long ignored );

-static DEFINE_TIMER(sound_timer, nosound, 0, 0);
+static DEFINE_TIMER(sound_timer, nosound);
  
  void amiga_mksound( unsigned int hz, unsigned int ticks )

  {
diff --git a/arch/m68k/mac/macboing.c b/arch/m68k/mac/macboing.c
index ffaa1f6439ae..9a52aff183d0 100644
--- a/arch/m68k/mac/macboing.c
+++ b/arch/m68k/mac/macboing.c
@@ -56,7 +56,7 @@ static void ( *mac_special_bell )( unsigned int, unsigned 
int, unsigned int );
  /*
   * our timer to start/continue/stop the bell
   */
-static DEFINE_TIMER(mac_sound_timer, mac_nosound, 0, 0);
+static DEFINE_TIMER(mac_sound_timer, mac_nosound);
  
  /*

   * Sort of initialize the sound chip (called from mac_mksound on the first

Re: nfc: nci: fix potential NULL pointer dereference

2017-06-12 Thread Guenter Roeck
On Mon, Jun 12, 2017 at 05:02:23PM -0500, Gustavo A. R. Silva wrote:
> NULL check at line 76: if (conn_info) {, implies that pointer conn_info
> might be NULL, but this pointer is being previously dereferenced,
> which might cause a NULL pointer dereference.
> 
> Add NULL check before dereferencing pointer conn_info in order to
> avoid a potential NULL pointer dereference.
> 
> Addresses-Coverity-ID: 1362349
> Signed-off-by: Gustavo A. R. Silva 
> ---
>  net/nfc/nci/core.c | 11 +--
>  1 file changed, 5 insertions(+), 6 deletions(-)
> 
> diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c
> index 61fff42..d2198ce 100644
> --- a/net/nfc/nci/core.c
> +++ b/net/nfc/nci/core.c
> @@ -70,14 +70,13 @@ int nci_get_conn_info_by_dest_type_params(struct nci_dev 
> *ndev, u8 dest_type,
>   struct nci_conn_info *conn_info;
>  
>   list_for_each_entry(conn_info, &ndev->conn_info_list, list) {

conn_info is set in list_for_each_entry() using container_of(),
which is never NULL. Plus, it is dereferenced there as well.
The check is unnecessary.

Guenter

> - if (conn_info->dest_type == dest_type) {
> + if (conn_info && conn_info->dest_type == dest_type) {
>   if (!params)
>   return conn_info->conn_id;
> - if (conn_info) {
> - if (params->id == conn_info->dest_params->id &&
> - params->protocol == 
> conn_info->dest_params->protocol)
> - return conn_info->conn_id;
> - }
> +
> + if (params->id == conn_info->dest_params->id &&
> + params->protocol == 
> conn_info->dest_params->protocol)
> + return conn_info->conn_id;
>   }
>   }
>  


Re: nfc: nci: fix potential NULL pointer dereference

2017-06-12 Thread Guenter Roeck

On 06/12/2017 03:28 PM, Gustavo A. R. Silva wrote:

Hi Guenter,

Please, see my comments below

Quoting Guenter Roeck :


On Mon, Jun 12, 2017 at 05:02:23PM -0500, Gustavo A. R. Silva wrote:

NULL check at line 76: if (conn_info) {, implies that pointer conn_info
might be NULL, but this pointer is being previously dereferenced,
which might cause a NULL pointer dereference.

Add NULL check before dereferencing pointer conn_info in order to
avoid a potential NULL pointer dereference.

Addresses-Coverity-ID: 1362349
Signed-off-by: Gustavo A. R. Silva 
---
 net/nfc/nci/core.c | 11 +--
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c
index 61fff42..d2198ce 100644
--- a/net/nfc/nci/core.c
+++ b/net/nfc/nci/core.c
@@ -70,14 +70,13 @@ int nci_get_conn_info_by_dest_type_params(struct nci_dev 
*ndev, u8 dest_type,
 struct nci_conn_info *conn_info;

 list_for_each_entry(conn_info, &ndev->conn_info_list, list) {


conn_info is set in list_for_each_entry() using container_of(),
which is never NULL. Plus, it is dereferenced there as well.
The check is unnecessary.



Thanks for clarifying.


Guenter


-if (conn_info->dest_type == dest_type) {
+if (conn_info && conn_info->dest_type == dest_type) {
 if (!params)
 return conn_info->conn_id;
-if (conn_info) {


So, this NULL check could be removed as it seems it is not useful at all ?


Exactly.


-if (params->id == conn_info->dest_params->id &&
-params->protocol == conn_info->dest_params->protocol)
-return conn_info->conn_id;
-}
+
+if (params->id == conn_info->dest_params->id &&
+params->protocol == conn_info->dest_params->protocol)
+return conn_info->conn_id;
 }
 }



Thank you
--
Gustavo A. R. Silva











Re: [PATCH] nfc: nci: remove unnecessary null check

2017-06-15 Thread Guenter Roeck
On Tue, Jun 13, 2017 at 11:37:18AM -0500, Gustavo A. R. Silva wrote:
> Remove unnecessary NULL check for pointer conn_info.
> conn_info is set in list_for_each_entry() using container_of(),
> which is never NULL.
> 
> Addresses-Coverity-ID: 1362349
> Cc: Guenter Roeck 
> Signed-off-by: Gustavo A. R. Silva 

Reviewed-by: Guenter Roeck 

> ---
>  net/nfc/nci/core.c | 9 -
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c
> index 61fff42..c15cb88 100644
> --- a/net/nfc/nci/core.c
> +++ b/net/nfc/nci/core.c
> @@ -73,11 +73,10 @@ int nci_get_conn_info_by_dest_type_params(struct nci_dev 
> *ndev, u8 dest_type,
>   if (conn_info->dest_type == dest_type) {
>   if (!params)
>   return conn_info->conn_id;
> - if (conn_info) {
> - if (params->id == conn_info->dest_params->id &&
> - params->protocol == 
> conn_info->dest_params->protocol)
> - return conn_info->conn_id;
> - }
> +
> + if (params->id == conn_info->dest_params->id &&
> + params->protocol == 
> conn_info->dest_params->protocol)
> + return conn_info->conn_id;
>   }
>   }
>  
> -- 
> 2.5.0
>