Staging driver fixes for 5.10-rc2
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 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> -----BEGIN PGP SIGNATURE----- iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCX56w1A8cZ3JlZ0Brcm9h aC5jb20ACgkQMUfUDdst+ykfmQCeKIsfQTrYgmmclsRK1JNCukN+7qwAoNeVC4wC DXYKU8K7K0Ejn/Qgro25 =NkLq -----END PGP SIGNATURE----- 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
This commit is contained in:
commit
2376cca02d
@ -1342,6 +1342,7 @@ static int cb_pcidas_auto_attach(struct comedi_device *dev,
|
||||
if (dev->irq && board->has_ao_fifo) {
|
||||
dev->write_subdev = s;
|
||||
s->subdev_flags |= SDF_CMD_WRITE;
|
||||
s->len_chanlist = s->n_chan;
|
||||
s->do_cmdtest = cb_pcidas_ao_cmdtest;
|
||||
s->do_cmd = cb_pcidas_ao_cmd;
|
||||
s->cancel = cb_pcidas_ao_cancel;
|
||||
|
@ -293,7 +293,7 @@ static int controller_probe(struct platform_device *pdev)
|
||||
regulator = devm_regulator_register(dev, &can_power_desc, &config);
|
||||
if (IS_ERR(regulator)) {
|
||||
err = PTR_ERR(regulator);
|
||||
goto out_reset;
|
||||
goto out_ida;
|
||||
}
|
||||
/* make controller info visible to userspace */
|
||||
cd->class_dev = kzalloc(sizeof(*cd->class_dev), GFP_KERNEL);
|
||||
|
@ -147,12 +147,6 @@ int cvm_oct_phy_setup_device(struct net_device *dev)
|
||||
|
||||
phy_node = of_parse_phandle(priv->of_node, "phy-handle", 0);
|
||||
if (!phy_node && of_phy_is_fixed_link(priv->of_node)) {
|
||||
int rc;
|
||||
|
||||
rc = of_phy_register_fixed_link(priv->of_node);
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
phy_node = of_node_get(priv->of_node);
|
||||
}
|
||||
if (!phy_node)
|
||||
|
@ -69,15 +69,17 @@ static inline int cvm_oct_check_rcv_error(struct cvmx_wqe *work)
|
||||
else
|
||||
port = work->word1.cn38xx.ipprt;
|
||||
|
||||
if ((work->word2.snoip.err_code == 10) && (work->word1.len <= 64)) {
|
||||
if ((work->word2.snoip.err_code == 10) && (work->word1.len <= 64))
|
||||
/*
|
||||
* Ignore length errors on min size packets. Some
|
||||
* equipment incorrectly pads packets to 64+4FCS
|
||||
* instead of 60+4FCS. Note these packets still get
|
||||
* counted as frame errors.
|
||||
*/
|
||||
} else if (work->word2.snoip.err_code == 5 ||
|
||||
work->word2.snoip.err_code == 7) {
|
||||
return 0;
|
||||
|
||||
if (work->word2.snoip.err_code == 5 ||
|
||||
work->word2.snoip.err_code == 7) {
|
||||
/*
|
||||
* We received a packet with either an alignment error
|
||||
* 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)
|
||||
/* Port received 0xd5 preamble */
|
||||
work->packet_ptr.s.addr += i + 1;
|
||||
work->word1.len -= i + 5;
|
||||
} else if ((*ptr & 0xf) == 0xd) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((*ptr & 0xf) == 0xd) {
|
||||
/* Port received 0xd preamble */
|
||||
work->packet_ptr.s.addr += i;
|
||||
work->word1.len -= i + 4;
|
||||
@ -118,21 +123,20 @@ static inline int cvm_oct_check_rcv_error(struct cvmx_wqe *work)
|
||||
((*(ptr + 1) & 0xf) << 4);
|
||||
ptr++;
|
||||
}
|
||||
} else {
|
||||
printk_ratelimited("Port %d unknown preamble, packet dropped\n",
|
||||
port);
|
||||
cvm_oct_free_work(work);
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
printk_ratelimited("Port %d unknown preamble, packet dropped\n",
|
||||
port);
|
||||
cvm_oct_free_work(work);
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
printk_ratelimited("Port %d receive error code %d, packet dropped\n",
|
||||
port, work->word2.snoip.err_code);
|
||||
cvm_oct_free_work(work);
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
printk_ratelimited("Port %d receive error code %d, packet dropped\n",
|
||||
port, work->word2.snoip.err_code);
|
||||
cvm_oct_free_work(work);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void copy_segments_to_skb(struct cvmx_wqe *work, struct sk_buff *skb)
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include <linux/phy.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/of_mdio.h>
|
||||
#include <linux/of_net.h>
|
||||
#include <linux/if_ether.h>
|
||||
#include <linux/if_vlan.h>
|
||||
@ -892,6 +893,14 @@ static int cvm_oct_probe(struct platform_device *pdev)
|
||||
break;
|
||||
}
|
||||
|
||||
if (priv->of_node && of_phy_is_fixed_link(priv->of_node)) {
|
||||
if (of_phy_register_fixed_link(priv->of_node)) {
|
||||
netdev_err(dev, "Failed to register fixed link for interface %d, port %d\n",
|
||||
interface, priv->port);
|
||||
dev->netdev_ops = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (!dev->netdev_ops) {
|
||||
free_netdev(dev);
|
||||
} else if (register_netdev(dev) < 0) {
|
||||
|
@ -179,6 +179,9 @@ struct vchiq_mmal_instance {
|
||||
|
||||
/* ordered workqueue to process all bulk operations */
|
||||
struct workqueue_struct *bulk_wq;
|
||||
|
||||
/* handle for a vchiq instance */
|
||||
struct vchiq_instance *vchiq_instance;
|
||||
};
|
||||
|
||||
static struct mmal_msg_context *
|
||||
@ -1840,6 +1843,7 @@ int vchiq_mmal_finalise(struct vchiq_mmal_instance *instance)
|
||||
|
||||
mutex_unlock(&instance->vchiq_mutex);
|
||||
|
||||
vchiq_shutdown(instance->vchiq_instance);
|
||||
flush_workqueue(instance->bulk_wq);
|
||||
destroy_workqueue(instance->bulk_wq);
|
||||
|
||||
@ -1856,6 +1860,7 @@ EXPORT_SYMBOL_GPL(vchiq_mmal_finalise);
|
||||
int vchiq_mmal_init(struct vchiq_mmal_instance **out_instance)
|
||||
{
|
||||
int status;
|
||||
int err = -ENODEV;
|
||||
struct vchiq_mmal_instance *instance;
|
||||
static struct vchiq_instance *vchiq_instance;
|
||||
struct vchiq_service_params_kernel params = {
|
||||
@ -1890,17 +1895,21 @@ int vchiq_mmal_init(struct vchiq_mmal_instance **out_instance)
|
||||
status = vchiq_connect(vchiq_instance);
|
||||
if (status) {
|
||||
pr_err("Failed to connect VCHI instance (status=%d)\n", status);
|
||||
return -EIO;
|
||||
err = -EIO;
|
||||
goto err_shutdown_vchiq;
|
||||
}
|
||||
|
||||
instance = kzalloc(sizeof(*instance), GFP_KERNEL);
|
||||
|
||||
if (!instance)
|
||||
return -ENOMEM;
|
||||
if (!instance) {
|
||||
err = -ENOMEM;
|
||||
goto err_shutdown_vchiq;
|
||||
}
|
||||
|
||||
mutex_init(&instance->vchiq_mutex);
|
||||
|
||||
instance->bulk_scratch = vmalloc(PAGE_SIZE);
|
||||
instance->vchiq_instance = vchiq_instance;
|
||||
|
||||
mutex_init(&instance->context_map_lock);
|
||||
idr_init_base(&instance->context_map, 1);
|
||||
@ -1932,7 +1941,9 @@ err_close_services:
|
||||
err_free:
|
||||
vfree(instance->bulk_scratch);
|
||||
kfree(instance);
|
||||
return -ENODEV;
|
||||
err_shutdown_vchiq:
|
||||
vchiq_shutdown(vchiq_instance);
|
||||
return err;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(vchiq_mmal_init);
|
||||
|
||||
|
@ -21,7 +21,7 @@ static void device_wakeup(struct wfx_dev *wdev)
|
||||
|
||||
if (!wdev->pdata.gpio_wakeup)
|
||||
return;
|
||||
if (gpiod_get_value_cansleep(wdev->pdata.gpio_wakeup) >= 0)
|
||||
if (gpiod_get_value_cansleep(wdev->pdata.gpio_wakeup) > 0)
|
||||
return;
|
||||
|
||||
if (wfx_api_older_than(wdev, 1, 4)) {
|
||||
|
@ -31,13 +31,13 @@ static int wfx_get_hw_rate(struct wfx_dev *wdev,
|
||||
}
|
||||
return rate->idx + 14;
|
||||
}
|
||||
// WFx only support 2GHz, else band information should be retrieved
|
||||
// from ieee80211_tx_info
|
||||
band = wdev->hw->wiphy->bands[NL80211_BAND_2GHZ];
|
||||
if (rate->idx >= band->n_bitrates) {
|
||||
WARN(1, "wrong rate->idx value: %d", rate->idx);
|
||||
return -1;
|
||||
}
|
||||
// WFx only support 2GHz, else band information should be retrieved
|
||||
// from ieee80211_tx_info
|
||||
band = wdev->hw->wiphy->bands[NL80211_BAND_2GHZ];
|
||||
return band->bitrates[rate->idx].hw_value;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user