Skip to content

Commit 2376cca

Browse files
committed
Merge tag 'staging-5.10-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging driver fixes from Greg KH: "Here are some small staging driver fixes for issues that have been reported in 5.10-rc1: - octeon driver fixes - wfx driver fixes - memory leak fix in vchiq driver - fieldbus driver bugfix - comedi driver bugfix All of these have been in linux-next with no reported issues" * tag 'staging-5.10-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: staging: fieldbus: anybuss: jump to correct label in an error path staging: wfx: fix test on return value of gpiod_get_value() staging: wfx: fix use of uninitialized pointer staging: mmal-vchiq: Fix memory leak for vchiq_instance staging: comedi: cb_pcidas: Allow 2-channel commands for AO subdevice staging: octeon: Drop on uncorrectable alignment or FCS error staging: octeon: repair "fixed-link" support
2 parents 2754a42 + 7e97e4c commit 2376cca

8 files changed

Lines changed: 49 additions & 30 deletions

File tree

drivers/staging/comedi/drivers/cb_pcidas.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1342,6 +1342,7 @@ static int cb_pcidas_auto_attach(struct comedi_device *dev,
13421342
if (dev->irq && board->has_ao_fifo) {
13431343
dev->write_subdev = s;
13441344
s->subdev_flags |= SDF_CMD_WRITE;
1345+
s->len_chanlist = s->n_chan;
13451346
s->do_cmdtest = cb_pcidas_ao_cmdtest;
13461347
s->do_cmd = cb_pcidas_ao_cmd;
13471348
s->cancel = cb_pcidas_ao_cancel;

drivers/staging/fieldbus/anybuss/arcx-anybus.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ static int controller_probe(struct platform_device *pdev)
293293
regulator = devm_regulator_register(dev, &can_power_desc, &config);
294294
if (IS_ERR(regulator)) {
295295
err = PTR_ERR(regulator);
296-
goto out_reset;
296+
goto out_ida;
297297
}
298298
/* make controller info visible to userspace */
299299
cd->class_dev = kzalloc(sizeof(*cd->class_dev), GFP_KERNEL);

drivers/staging/octeon/ethernet-mdio.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,6 @@ int cvm_oct_phy_setup_device(struct net_device *dev)
147147

148148
phy_node = of_parse_phandle(priv->of_node, "phy-handle", 0);
149149
if (!phy_node && of_phy_is_fixed_link(priv->of_node)) {
150-
int rc;
151-
152-
rc = of_phy_register_fixed_link(priv->of_node);
153-
if (rc)
154-
return rc;
155-
156150
phy_node = of_node_get(priv->of_node);
157151
}
158152
if (!phy_node)

drivers/staging/octeon/ethernet-rx.c

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,17 @@ static inline int cvm_oct_check_rcv_error(struct cvmx_wqe *work)
6969
else
7070
port = work->word1.cn38xx.ipprt;
7171

72-
if ((work->word2.snoip.err_code == 10) && (work->word1.len <= 64)) {
72+
if ((work->word2.snoip.err_code == 10) && (work->word1.len <= 64))
7373
/*
7474
* Ignore length errors on min size packets. Some
7575
* equipment incorrectly pads packets to 64+4FCS
7676
* instead of 60+4FCS. Note these packets still get
7777
* counted as frame errors.
7878
*/
79-
} else if (work->word2.snoip.err_code == 5 ||
80-
work->word2.snoip.err_code == 7) {
79+
return 0;
80+
81+
if (work->word2.snoip.err_code == 5 ||
82+
work->word2.snoip.err_code == 7) {
8183
/*
8284
* We received a packet with either an alignment error
8385
* or a FCS error. This may be signalling that we are
@@ -108,7 +110,10 @@ static inline int cvm_oct_check_rcv_error(struct cvmx_wqe *work)
108110
/* Port received 0xd5 preamble */
109111
work->packet_ptr.s.addr += i + 1;
110112
work->word1.len -= i + 5;
111-
} else if ((*ptr & 0xf) == 0xd) {
113+
return 0;
114+
}
115+
116+
if ((*ptr & 0xf) == 0xd) {
112117
/* Port received 0xd preamble */
113118
work->packet_ptr.s.addr += i;
114119
work->word1.len -= i + 4;
@@ -118,21 +123,20 @@ static inline int cvm_oct_check_rcv_error(struct cvmx_wqe *work)
118123
((*(ptr + 1) & 0xf) << 4);
119124
ptr++;
120125
}
121-
} else {
122-
printk_ratelimited("Port %d unknown preamble, packet dropped\n",
123-
port);
124-
cvm_oct_free_work(work);
125-
return 1;
126+
return 0;
126127
}
128+
129+
printk_ratelimited("Port %d unknown preamble, packet dropped\n",
130+
port);
131+
cvm_oct_free_work(work);
132+
return 1;
127133
}
128-
} else {
129-
printk_ratelimited("Port %d receive error code %d, packet dropped\n",
130-
port, work->word2.snoip.err_code);
131-
cvm_oct_free_work(work);
132-
return 1;
133134
}
134135

135-
return 0;
136+
printk_ratelimited("Port %d receive error code %d, packet dropped\n",
137+
port, work->word2.snoip.err_code);
138+
cvm_oct_free_work(work);
139+
return 1;
136140
}
137141

138142
static void copy_segments_to_skb(struct cvmx_wqe *work, struct sk_buff *skb)

drivers/staging/octeon/ethernet.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <linux/phy.h>
1414
#include <linux/slab.h>
1515
#include <linux/interrupt.h>
16+
#include <linux/of_mdio.h>
1617
#include <linux/of_net.h>
1718
#include <linux/if_ether.h>
1819
#include <linux/if_vlan.h>
@@ -892,6 +893,14 @@ static int cvm_oct_probe(struct platform_device *pdev)
892893
break;
893894
}
894895

896+
if (priv->of_node && of_phy_is_fixed_link(priv->of_node)) {
897+
if (of_phy_register_fixed_link(priv->of_node)) {
898+
netdev_err(dev, "Failed to register fixed link for interface %d, port %d\n",
899+
interface, priv->port);
900+
dev->netdev_ops = NULL;
901+
}
902+
}
903+
895904
if (!dev->netdev_ops) {
896905
free_netdev(dev);
897906
} else if (register_netdev(dev) < 0) {

drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,9 @@ struct vchiq_mmal_instance {
179179

180180
/* ordered workqueue to process all bulk operations */
181181
struct workqueue_struct *bulk_wq;
182+
183+
/* handle for a vchiq instance */
184+
struct vchiq_instance *vchiq_instance;
182185
};
183186

184187
static struct mmal_msg_context *
@@ -1840,6 +1843,7 @@ int vchiq_mmal_finalise(struct vchiq_mmal_instance *instance)
18401843

18411844
mutex_unlock(&instance->vchiq_mutex);
18421845

1846+
vchiq_shutdown(instance->vchiq_instance);
18431847
flush_workqueue(instance->bulk_wq);
18441848
destroy_workqueue(instance->bulk_wq);
18451849

@@ -1856,6 +1860,7 @@ EXPORT_SYMBOL_GPL(vchiq_mmal_finalise);
18561860
int vchiq_mmal_init(struct vchiq_mmal_instance **out_instance)
18571861
{
18581862
int status;
1863+
int err = -ENODEV;
18591864
struct vchiq_mmal_instance *instance;
18601865
static struct vchiq_instance *vchiq_instance;
18611866
struct vchiq_service_params_kernel params = {
@@ -1890,17 +1895,21 @@ int vchiq_mmal_init(struct vchiq_mmal_instance **out_instance)
18901895
status = vchiq_connect(vchiq_instance);
18911896
if (status) {
18921897
pr_err("Failed to connect VCHI instance (status=%d)\n", status);
1893-
return -EIO;
1898+
err = -EIO;
1899+
goto err_shutdown_vchiq;
18941900
}
18951901

18961902
instance = kzalloc(sizeof(*instance), GFP_KERNEL);
18971903

1898-
if (!instance)
1899-
return -ENOMEM;
1904+
if (!instance) {
1905+
err = -ENOMEM;
1906+
goto err_shutdown_vchiq;
1907+
}
19001908

19011909
mutex_init(&instance->vchiq_mutex);
19021910

19031911
instance->bulk_scratch = vmalloc(PAGE_SIZE);
1912+
instance->vchiq_instance = vchiq_instance;
19041913

19051914
mutex_init(&instance->context_map_lock);
19061915
idr_init_base(&instance->context_map, 1);
@@ -1932,7 +1941,9 @@ int vchiq_mmal_init(struct vchiq_mmal_instance **out_instance)
19321941
err_free:
19331942
vfree(instance->bulk_scratch);
19341943
kfree(instance);
1935-
return -ENODEV;
1944+
err_shutdown_vchiq:
1945+
vchiq_shutdown(vchiq_instance);
1946+
return err;
19361947
}
19371948
EXPORT_SYMBOL_GPL(vchiq_mmal_init);
19381949

drivers/staging/wfx/bh.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ static void device_wakeup(struct wfx_dev *wdev)
2121

2222
if (!wdev->pdata.gpio_wakeup)
2323
return;
24-
if (gpiod_get_value_cansleep(wdev->pdata.gpio_wakeup) >= 0)
24+
if (gpiod_get_value_cansleep(wdev->pdata.gpio_wakeup) > 0)
2525
return;
2626

2727
if (wfx_api_older_than(wdev, 1, 4)) {

drivers/staging/wfx/data_tx.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ static int wfx_get_hw_rate(struct wfx_dev *wdev,
3131
}
3232
return rate->idx + 14;
3333
}
34+
// WFx only support 2GHz, else band information should be retrieved
35+
// from ieee80211_tx_info
36+
band = wdev->hw->wiphy->bands[NL80211_BAND_2GHZ];
3437
if (rate->idx >= band->n_bitrates) {
3538
WARN(1, "wrong rate->idx value: %d", rate->idx);
3639
return -1;
3740
}
38-
// WFx only support 2GHz, else band information should be retrieved
39-
// from ieee80211_tx_info
40-
band = wdev->hw->wiphy->bands[NL80211_BAND_2GHZ];
4141
return band->bitrates[rate->idx].hw_value;
4242
}
4343

0 commit comments

Comments
 (0)