Merge 33713f7cda
("platform/mellanox: mlxreg-lc: Fix logic error in power state check") into android15-6.6-lts
Steps on the way to 6.6.97 Change-Id: Ia15ff4f8369ed7b7b4f61728dd0355190c397f5c Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
@@ -711,7 +711,7 @@ Description: This file shows the thin provisioning type. This is one of
|
|||||||
|
|
||||||
The file is read only.
|
The file is read only.
|
||||||
|
|
||||||
What: /sys/class/scsi_device/*/device/unit_descriptor/physical_memory_resourse_count
|
What: /sys/class/scsi_device/*/device/unit_descriptor/physical_memory_resource_count
|
||||||
Date: February 2018
|
Date: February 2018
|
||||||
Contact: Stanislav Nijnikov <stanislav.nijnikov@wdc.com>
|
Contact: Stanislav Nijnikov <stanislav.nijnikov@wdc.com>
|
||||||
Description: This file shows the total physical memory resources. This is
|
Description: This file shows the total physical memory resources. This is
|
||||||
|
@@ -71,7 +71,7 @@
|
|||||||
*/
|
*/
|
||||||
&port00 {
|
&port00 {
|
||||||
bus-range = <1 1>;
|
bus-range = <1 1>;
|
||||||
wifi0: network@0,0 {
|
wifi0: wifi@0,0 {
|
||||||
compatible = "pci14e4,4425";
|
compatible = "pci14e4,4425";
|
||||||
reg = <0x10000 0x0 0x0 0x0 0x0>;
|
reg = <0x10000 0x0 0x0 0x0 0x0>;
|
||||||
/* To be filled by the loader */
|
/* To be filled by the loader */
|
||||||
|
@@ -1064,6 +1064,20 @@
|
|||||||
status = "disabled";
|
status = "disabled";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
uart14: serial@898000 {
|
||||||
|
compatible = "qcom,geni-uart";
|
||||||
|
reg = <0 0x898000 0 0x4000>;
|
||||||
|
clock-names = "se";
|
||||||
|
clocks = <&gcc GCC_QUPV3_WRAP2_S6_CLK>;
|
||||||
|
pinctrl-names = "default";
|
||||||
|
pinctrl-0 = <&qup_uart14_default>, <&qup_uart14_cts_rts>;
|
||||||
|
interrupts = <GIC_SPI 461 IRQ_TYPE_LEVEL_HIGH>;
|
||||||
|
interconnects = <&clk_virt MASTER_QUP_CORE_2 0 &clk_virt SLAVE_QUP_CORE_2 0>,
|
||||||
|
<&gem_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_QUP_2 0>;
|
||||||
|
interconnect-names = "qup-core", "qup-config";
|
||||||
|
status = "disabled";
|
||||||
|
};
|
||||||
|
|
||||||
i2c15: i2c@89c000 {
|
i2c15: i2c@89c000 {
|
||||||
compatible = "qcom,geni-i2c";
|
compatible = "qcom,geni-i2c";
|
||||||
reg = <0 0x0089c000 0 0x4000>;
|
reg = <0 0x0089c000 0 0x4000>;
|
||||||
@@ -3640,6 +3654,22 @@
|
|||||||
bias-disable;
|
bias-disable;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
qup_uart14_default: qup-uart14-default-state {
|
||||||
|
/* TX, RX */
|
||||||
|
pins = "gpio78", "gpio79";
|
||||||
|
function = "qup2_se6";
|
||||||
|
drive-strength = <2>;
|
||||||
|
bias-pull-up;
|
||||||
|
};
|
||||||
|
|
||||||
|
qup_uart14_cts_rts: qup-uart14-cts-rts-state {
|
||||||
|
/* CTS, RTS */
|
||||||
|
pins = "gpio76", "gpio77";
|
||||||
|
function = "qup2_se6";
|
||||||
|
drive-strength = <2>;
|
||||||
|
bias-pull-down;
|
||||||
|
};
|
||||||
|
|
||||||
sdc2_sleep: sdc2-sleep-state {
|
sdc2_sleep: sdc2-sleep-state {
|
||||||
clk-pins {
|
clk-pins {
|
||||||
pins = "sdc2_clk";
|
pins = "sdc2_clk";
|
||||||
|
@@ -98,6 +98,10 @@ static pci_ers_result_t zpci_event_do_error_state_clear(struct pci_dev *pdev,
|
|||||||
struct zpci_dev *zdev = to_zpci(pdev);
|
struct zpci_dev *zdev = to_zpci(pdev);
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
|
/* The underlying device may have been disabled by the event */
|
||||||
|
if (!zdev_enabled(zdev))
|
||||||
|
return PCI_ERS_RESULT_NEED_RESET;
|
||||||
|
|
||||||
pr_info("%s: Unblocking device access for examination\n", pci_name(pdev));
|
pr_info("%s: Unblocking device access for examination\n", pci_name(pdev));
|
||||||
rc = zpci_reset_load_store_blocked(zdev);
|
rc = zpci_reset_load_store_blocked(zdev);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
|
@@ -187,6 +187,7 @@ struct fimd_context {
|
|||||||
u32 i80ifcon;
|
u32 i80ifcon;
|
||||||
bool i80_if;
|
bool i80_if;
|
||||||
bool suspended;
|
bool suspended;
|
||||||
|
bool dp_clk_enabled;
|
||||||
wait_queue_head_t wait_vsync_queue;
|
wait_queue_head_t wait_vsync_queue;
|
||||||
atomic_t wait_vsync_event;
|
atomic_t wait_vsync_event;
|
||||||
atomic_t win_updated;
|
atomic_t win_updated;
|
||||||
@@ -1047,7 +1048,18 @@ static void fimd_dp_clock_enable(struct exynos_drm_clk *clk, bool enable)
|
|||||||
struct fimd_context *ctx = container_of(clk, struct fimd_context,
|
struct fimd_context *ctx = container_of(clk, struct fimd_context,
|
||||||
dp_clk);
|
dp_clk);
|
||||||
u32 val = enable ? DP_MIE_CLK_DP_ENABLE : DP_MIE_CLK_DISABLE;
|
u32 val = enable ? DP_MIE_CLK_DP_ENABLE : DP_MIE_CLK_DISABLE;
|
||||||
|
|
||||||
|
if (enable == ctx->dp_clk_enabled)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (enable)
|
||||||
|
pm_runtime_resume_and_get(ctx->dev);
|
||||||
|
|
||||||
|
ctx->dp_clk_enabled = enable;
|
||||||
writel(val, ctx->regs + DP_MIE_CLKCON);
|
writel(val, ctx->regs + DP_MIE_CLKCON);
|
||||||
|
|
||||||
|
if (!enable)
|
||||||
|
pm_runtime_put(ctx->dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct exynos_drm_crtc_ops fimd_crtc_ops = {
|
static const struct exynos_drm_crtc_ops fimd_crtc_ops = {
|
||||||
|
@@ -73,8 +73,8 @@ static int igt_add_request(void *arg)
|
|||||||
/* Basic preliminary test to create a request and let it loose! */
|
/* Basic preliminary test to create a request and let it loose! */
|
||||||
|
|
||||||
request = mock_request(rcs0(i915)->kernel_context, HZ / 10);
|
request = mock_request(rcs0(i915)->kernel_context, HZ / 10);
|
||||||
if (!request)
|
if (IS_ERR(request))
|
||||||
return -ENOMEM;
|
return PTR_ERR(request);
|
||||||
|
|
||||||
i915_request_add(request);
|
i915_request_add(request);
|
||||||
|
|
||||||
@@ -91,8 +91,8 @@ static int igt_wait_request(void *arg)
|
|||||||
/* Submit a request, then wait upon it */
|
/* Submit a request, then wait upon it */
|
||||||
|
|
||||||
request = mock_request(rcs0(i915)->kernel_context, T);
|
request = mock_request(rcs0(i915)->kernel_context, T);
|
||||||
if (!request)
|
if (IS_ERR(request))
|
||||||
return -ENOMEM;
|
return PTR_ERR(request);
|
||||||
|
|
||||||
i915_request_get(request);
|
i915_request_get(request);
|
||||||
|
|
||||||
@@ -160,8 +160,8 @@ static int igt_fence_wait(void *arg)
|
|||||||
/* Submit a request, treat it as a fence and wait upon it */
|
/* Submit a request, treat it as a fence and wait upon it */
|
||||||
|
|
||||||
request = mock_request(rcs0(i915)->kernel_context, T);
|
request = mock_request(rcs0(i915)->kernel_context, T);
|
||||||
if (!request)
|
if (IS_ERR(request))
|
||||||
return -ENOMEM;
|
return PTR_ERR(request);
|
||||||
|
|
||||||
if (dma_fence_wait_timeout(&request->fence, false, T) != -ETIME) {
|
if (dma_fence_wait_timeout(&request->fence, false, T) != -ETIME) {
|
||||||
pr_err("fence wait success before submit (expected timeout)!\n");
|
pr_err("fence wait success before submit (expected timeout)!\n");
|
||||||
@@ -219,8 +219,8 @@ static int igt_request_rewind(void *arg)
|
|||||||
GEM_BUG_ON(IS_ERR(ce));
|
GEM_BUG_ON(IS_ERR(ce));
|
||||||
request = mock_request(ce, 2 * HZ);
|
request = mock_request(ce, 2 * HZ);
|
||||||
intel_context_put(ce);
|
intel_context_put(ce);
|
||||||
if (!request) {
|
if (IS_ERR(request)) {
|
||||||
err = -ENOMEM;
|
err = PTR_ERR(request);
|
||||||
goto err_context_0;
|
goto err_context_0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -237,8 +237,8 @@ static int igt_request_rewind(void *arg)
|
|||||||
GEM_BUG_ON(IS_ERR(ce));
|
GEM_BUG_ON(IS_ERR(ce));
|
||||||
vip = mock_request(ce, 0);
|
vip = mock_request(ce, 0);
|
||||||
intel_context_put(ce);
|
intel_context_put(ce);
|
||||||
if (!vip) {
|
if (IS_ERR(vip)) {
|
||||||
err = -ENOMEM;
|
err = PTR_ERR(vip);
|
||||||
goto err_context_1;
|
goto err_context_1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -35,7 +35,7 @@ mock_request(struct intel_context *ce, unsigned long delay)
|
|||||||
/* NB the i915->requests slab cache is enlarged to fit mock_request */
|
/* NB the i915->requests slab cache is enlarged to fit mock_request */
|
||||||
request = intel_context_create_request(ce);
|
request = intel_context_create_request(ce);
|
||||||
if (IS_ERR(request))
|
if (IS_ERR(request))
|
||||||
return NULL;
|
return request;
|
||||||
|
|
||||||
request->mock.delay = delay;
|
request->mock.delay = delay;
|
||||||
return request;
|
return request;
|
||||||
|
@@ -387,7 +387,7 @@ static int do_get_hw_stats(struct ib_device *ibdev,
|
|||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
/* We don't expose device counters over Vports */
|
/* We don't expose device counters over Vports */
|
||||||
if (is_mdev_switchdev_mode(dev->mdev) && port_num != 0)
|
if (is_mdev_switchdev_mode(dev->mdev) && dev->is_rep && port_num != 0)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
if (MLX5_CAP_PCAM_FEATURE(dev->mdev, rx_icrc_encapsulated_counter)) {
|
if (MLX5_CAP_PCAM_FEATURE(dev->mdev, rx_icrc_encapsulated_counter)) {
|
||||||
@@ -407,7 +407,7 @@ static int do_get_hw_stats(struct ib_device *ibdev,
|
|||||||
*/
|
*/
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
ret = mlx5_lag_query_cong_counters(dev->mdev,
|
ret = mlx5_lag_query_cong_counters(mdev,
|
||||||
stats->value +
|
stats->value +
|
||||||
cnts->num_q_counters,
|
cnts->num_q_counters,
|
||||||
cnts->num_cong_counters,
|
cnts->num_cong_counters,
|
||||||
|
@@ -1914,6 +1914,7 @@ subscribe_event_xa_alloc(struct mlx5_devx_event_table *devx_event_table,
|
|||||||
/* Level1 is valid for future use, no need to free */
|
/* Level1 is valid for future use, no need to free */
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
|
INIT_LIST_HEAD(&obj_event->obj_sub_list);
|
||||||
err = xa_insert(&event->object_ids,
|
err = xa_insert(&event->object_ids,
|
||||||
key_level2,
|
key_level2,
|
||||||
obj_event,
|
obj_event,
|
||||||
@@ -1922,7 +1923,6 @@ subscribe_event_xa_alloc(struct mlx5_devx_event_table *devx_event_table,
|
|||||||
kfree(obj_event);
|
kfree(obj_event);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
INIT_LIST_HEAD(&obj_event->obj_sub_list);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@@ -1690,6 +1690,33 @@ static void deallocate_uars(struct mlx5_ib_dev *dev,
|
|||||||
context->devx_uid);
|
context->devx_uid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int mlx5_ib_enable_lb_mp(struct mlx5_core_dev *master,
|
||||||
|
struct mlx5_core_dev *slave)
|
||||||
|
{
|
||||||
|
int err;
|
||||||
|
|
||||||
|
err = mlx5_nic_vport_update_local_lb(master, true);
|
||||||
|
if (err)
|
||||||
|
return err;
|
||||||
|
|
||||||
|
err = mlx5_nic_vport_update_local_lb(slave, true);
|
||||||
|
if (err)
|
||||||
|
goto out;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
out:
|
||||||
|
mlx5_nic_vport_update_local_lb(master, false);
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void mlx5_ib_disable_lb_mp(struct mlx5_core_dev *master,
|
||||||
|
struct mlx5_core_dev *slave)
|
||||||
|
{
|
||||||
|
mlx5_nic_vport_update_local_lb(slave, false);
|
||||||
|
mlx5_nic_vport_update_local_lb(master, false);
|
||||||
|
}
|
||||||
|
|
||||||
int mlx5_ib_enable_lb(struct mlx5_ib_dev *dev, bool td, bool qp)
|
int mlx5_ib_enable_lb(struct mlx5_ib_dev *dev, bool td, bool qp)
|
||||||
{
|
{
|
||||||
int err = 0;
|
int err = 0;
|
||||||
@@ -3224,6 +3251,8 @@ static void mlx5_ib_unbind_slave_port(struct mlx5_ib_dev *ibdev,
|
|||||||
|
|
||||||
lockdep_assert_held(&mlx5_ib_multiport_mutex);
|
lockdep_assert_held(&mlx5_ib_multiport_mutex);
|
||||||
|
|
||||||
|
mlx5_ib_disable_lb_mp(ibdev->mdev, mpi->mdev);
|
||||||
|
|
||||||
mlx5_core_mp_event_replay(ibdev->mdev,
|
mlx5_core_mp_event_replay(ibdev->mdev,
|
||||||
MLX5_DRIVER_EVENT_AFFILIATION_REMOVED,
|
MLX5_DRIVER_EVENT_AFFILIATION_REMOVED,
|
||||||
NULL);
|
NULL);
|
||||||
@@ -3319,6 +3348,10 @@ static bool mlx5_ib_bind_slave_port(struct mlx5_ib_dev *ibdev,
|
|||||||
MLX5_DRIVER_EVENT_AFFILIATION_DONE,
|
MLX5_DRIVER_EVENT_AFFILIATION_DONE,
|
||||||
&key);
|
&key);
|
||||||
|
|
||||||
|
err = mlx5_ib_enable_lb_mp(ibdev->mdev, mpi->mdev);
|
||||||
|
if (err)
|
||||||
|
goto unbind;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
unbind:
|
unbind:
|
||||||
|
@@ -44,6 +44,12 @@ static const struct mmc_fixup __maybe_unused mmc_sd_fixups[] = {
|
|||||||
0, -1ull, SDIO_ANY_ID, SDIO_ANY_ID, add_quirk_sd,
|
0, -1ull, SDIO_ANY_ID, SDIO_ANY_ID, add_quirk_sd,
|
||||||
MMC_QUIRK_NO_UHS_DDR50_TUNING, EXT_CSD_REV_ANY),
|
MMC_QUIRK_NO_UHS_DDR50_TUNING, EXT_CSD_REV_ANY),
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Some SD cards reports discard support while they don't
|
||||||
|
*/
|
||||||
|
MMC_FIXUP(CID_NAME_ANY, CID_MANFID_SANDISK_SD, 0x5344, add_quirk_sd,
|
||||||
|
MMC_QUIRK_BROKEN_SD_DISCARD),
|
||||||
|
|
||||||
END_FIXUP
|
END_FIXUP
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -147,12 +153,6 @@ static const struct mmc_fixup __maybe_unused mmc_blk_fixups[] = {
|
|||||||
MMC_FIXUP("M62704", CID_MANFID_KINGSTON, 0x0100, add_quirk_mmc,
|
MMC_FIXUP("M62704", CID_MANFID_KINGSTON, 0x0100, add_quirk_mmc,
|
||||||
MMC_QUIRK_TRIM_BROKEN),
|
MMC_QUIRK_TRIM_BROKEN),
|
||||||
|
|
||||||
/*
|
|
||||||
* Some SD cards reports discard support while they don't
|
|
||||||
*/
|
|
||||||
MMC_FIXUP(CID_NAME_ANY, CID_MANFID_SANDISK_SD, 0x5344, add_quirk_sd,
|
|
||||||
MMC_QUIRK_BROKEN_SD_DISCARD),
|
|
||||||
|
|
||||||
END_FIXUP
|
END_FIXUP
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -770,12 +770,18 @@ static inline void msdc_dma_setup(struct msdc_host *host, struct msdc_dma *dma,
|
|||||||
static void msdc_prepare_data(struct msdc_host *host, struct mmc_data *data)
|
static void msdc_prepare_data(struct msdc_host *host, struct mmc_data *data)
|
||||||
{
|
{
|
||||||
if (!(data->host_cookie & MSDC_PREPARE_FLAG)) {
|
if (!(data->host_cookie & MSDC_PREPARE_FLAG)) {
|
||||||
data->host_cookie |= MSDC_PREPARE_FLAG;
|
|
||||||
data->sg_count = dma_map_sg(host->dev, data->sg, data->sg_len,
|
data->sg_count = dma_map_sg(host->dev, data->sg, data->sg_len,
|
||||||
mmc_get_dma_dir(data));
|
mmc_get_dma_dir(data));
|
||||||
|
if (data->sg_count)
|
||||||
|
data->host_cookie |= MSDC_PREPARE_FLAG;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool msdc_data_prepared(struct mmc_data *data)
|
||||||
|
{
|
||||||
|
return data->host_cookie & MSDC_PREPARE_FLAG;
|
||||||
|
}
|
||||||
|
|
||||||
static void msdc_unprepare_data(struct msdc_host *host, struct mmc_data *data)
|
static void msdc_unprepare_data(struct msdc_host *host, struct mmc_data *data)
|
||||||
{
|
{
|
||||||
if (data->host_cookie & MSDC_ASYNC_FLAG)
|
if (data->host_cookie & MSDC_ASYNC_FLAG)
|
||||||
@@ -1338,8 +1344,19 @@ static void msdc_ops_request(struct mmc_host *mmc, struct mmc_request *mrq)
|
|||||||
WARN_ON(host->mrq);
|
WARN_ON(host->mrq);
|
||||||
host->mrq = mrq;
|
host->mrq = mrq;
|
||||||
|
|
||||||
if (mrq->data)
|
if (mrq->data) {
|
||||||
msdc_prepare_data(host, mrq->data);
|
msdc_prepare_data(host, mrq->data);
|
||||||
|
if (!msdc_data_prepared(mrq->data)) {
|
||||||
|
host->mrq = NULL;
|
||||||
|
/*
|
||||||
|
* Failed to prepare DMA area, fail fast before
|
||||||
|
* starting any commands.
|
||||||
|
*/
|
||||||
|
mrq->cmd->error = -ENOSPC;
|
||||||
|
mmc_request_done(mmc_from_priv(host), mrq);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* if SBC is required, we have HW option and SW option.
|
/* if SBC is required, we have HW option and SW option.
|
||||||
* if HW option is enabled, and SBC does not have "special" flags,
|
* if HW option is enabled, and SBC does not have "special" flags,
|
||||||
|
@@ -2035,15 +2035,10 @@ void sdhci_set_clock(struct sdhci_host *host, unsigned int clock)
|
|||||||
|
|
||||||
host->mmc->actual_clock = 0;
|
host->mmc->actual_clock = 0;
|
||||||
|
|
||||||
clk = sdhci_readw(host, SDHCI_CLOCK_CONTROL);
|
sdhci_writew(host, 0, SDHCI_CLOCK_CONTROL);
|
||||||
if (clk & SDHCI_CLOCK_CARD_EN)
|
|
||||||
sdhci_writew(host, clk & ~SDHCI_CLOCK_CARD_EN,
|
|
||||||
SDHCI_CLOCK_CONTROL);
|
|
||||||
|
|
||||||
if (clock == 0) {
|
if (clock == 0)
|
||||||
sdhci_writew(host, 0, SDHCI_CLOCK_CONTROL);
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
clk = sdhci_calc_clk(host, clock, &host->mmc->actual_clock);
|
clk = sdhci_calc_clk(host, clock, &host->mmc->actual_clock);
|
||||||
sdhci_enable_clk(host, clk);
|
sdhci_enable_clk(host, clk);
|
||||||
|
@@ -830,4 +830,20 @@ void sdhci_switch_external_dma(struct sdhci_host *host, bool en);
|
|||||||
void sdhci_set_data_timeout_irq(struct sdhci_host *host, bool enable);
|
void sdhci_set_data_timeout_irq(struct sdhci_host *host, bool enable);
|
||||||
void __sdhci_set_timeout(struct sdhci_host *host, struct mmc_command *cmd);
|
void __sdhci_set_timeout(struct sdhci_host *host, struct mmc_command *cmd);
|
||||||
|
|
||||||
|
#if defined(CONFIG_DYNAMIC_DEBUG) || \
|
||||||
|
(defined(CONFIG_DYNAMIC_DEBUG_CORE) && defined(DYNAMIC_DEBUG_MODULE))
|
||||||
|
#define SDHCI_DBG_ANYWAY 0
|
||||||
|
#elif defined(DEBUG)
|
||||||
|
#define SDHCI_DBG_ANYWAY 1
|
||||||
|
#else
|
||||||
|
#define SDHCI_DBG_ANYWAY 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define sdhci_dbg_dumpregs(host, fmt) \
|
||||||
|
do { \
|
||||||
|
DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \
|
||||||
|
if (DYNAMIC_DEBUG_BRANCH(descriptor) || SDHCI_DBG_ANYWAY) \
|
||||||
|
sdhci_dumpregs(host); \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
#endif /* __SDHCI_HW_H */
|
#endif /* __SDHCI_HW_H */
|
||||||
|
@@ -1861,14 +1861,21 @@ static u16 atl1_alloc_rx_buffers(struct atl1_adapter *adapter)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
buffer_info->alloced = 1;
|
|
||||||
buffer_info->skb = skb;
|
|
||||||
buffer_info->length = (u16) adapter->rx_buffer_len;
|
|
||||||
page = virt_to_page(skb->data);
|
page = virt_to_page(skb->data);
|
||||||
offset = offset_in_page(skb->data);
|
offset = offset_in_page(skb->data);
|
||||||
buffer_info->dma = dma_map_page(&pdev->dev, page, offset,
|
buffer_info->dma = dma_map_page(&pdev->dev, page, offset,
|
||||||
adapter->rx_buffer_len,
|
adapter->rx_buffer_len,
|
||||||
DMA_FROM_DEVICE);
|
DMA_FROM_DEVICE);
|
||||||
|
if (dma_mapping_error(&pdev->dev, buffer_info->dma)) {
|
||||||
|
kfree_skb(skb);
|
||||||
|
adapter->soft_stats.rx_dropped++;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
buffer_info->alloced = 1;
|
||||||
|
buffer_info->skb = skb;
|
||||||
|
buffer_info->length = (u16)adapter->rx_buffer_len;
|
||||||
|
|
||||||
rfd_desc->buffer_addr = cpu_to_le64(buffer_info->dma);
|
rfd_desc->buffer_addr = cpu_to_le64(buffer_info->dma);
|
||||||
rfd_desc->buf_len = cpu_to_le16(adapter->rx_buffer_len);
|
rfd_desc->buf_len = cpu_to_le16(adapter->rx_buffer_len);
|
||||||
rfd_desc->coalese = 0;
|
rfd_desc->coalese = 0;
|
||||||
@@ -2183,8 +2190,8 @@ static int atl1_tx_csum(struct atl1_adapter *adapter, struct sk_buff *skb,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void atl1_tx_map(struct atl1_adapter *adapter, struct sk_buff *skb,
|
static bool atl1_tx_map(struct atl1_adapter *adapter, struct sk_buff *skb,
|
||||||
struct tx_packet_desc *ptpd)
|
struct tx_packet_desc *ptpd)
|
||||||
{
|
{
|
||||||
struct atl1_tpd_ring *tpd_ring = &adapter->tpd_ring;
|
struct atl1_tpd_ring *tpd_ring = &adapter->tpd_ring;
|
||||||
struct atl1_buffer *buffer_info;
|
struct atl1_buffer *buffer_info;
|
||||||
@@ -2194,6 +2201,7 @@ static void atl1_tx_map(struct atl1_adapter *adapter, struct sk_buff *skb,
|
|||||||
unsigned int nr_frags;
|
unsigned int nr_frags;
|
||||||
unsigned int f;
|
unsigned int f;
|
||||||
int retval;
|
int retval;
|
||||||
|
u16 first_mapped;
|
||||||
u16 next_to_use;
|
u16 next_to_use;
|
||||||
u16 data_len;
|
u16 data_len;
|
||||||
u8 hdr_len;
|
u8 hdr_len;
|
||||||
@@ -2201,6 +2209,7 @@ static void atl1_tx_map(struct atl1_adapter *adapter, struct sk_buff *skb,
|
|||||||
buf_len -= skb->data_len;
|
buf_len -= skb->data_len;
|
||||||
nr_frags = skb_shinfo(skb)->nr_frags;
|
nr_frags = skb_shinfo(skb)->nr_frags;
|
||||||
next_to_use = atomic_read(&tpd_ring->next_to_use);
|
next_to_use = atomic_read(&tpd_ring->next_to_use);
|
||||||
|
first_mapped = next_to_use;
|
||||||
buffer_info = &tpd_ring->buffer_info[next_to_use];
|
buffer_info = &tpd_ring->buffer_info[next_to_use];
|
||||||
BUG_ON(buffer_info->skb);
|
BUG_ON(buffer_info->skb);
|
||||||
/* put skb in last TPD */
|
/* put skb in last TPD */
|
||||||
@@ -2216,6 +2225,8 @@ static void atl1_tx_map(struct atl1_adapter *adapter, struct sk_buff *skb,
|
|||||||
buffer_info->dma = dma_map_page(&adapter->pdev->dev, page,
|
buffer_info->dma = dma_map_page(&adapter->pdev->dev, page,
|
||||||
offset, hdr_len,
|
offset, hdr_len,
|
||||||
DMA_TO_DEVICE);
|
DMA_TO_DEVICE);
|
||||||
|
if (dma_mapping_error(&adapter->pdev->dev, buffer_info->dma))
|
||||||
|
goto dma_err;
|
||||||
|
|
||||||
if (++next_to_use == tpd_ring->count)
|
if (++next_to_use == tpd_ring->count)
|
||||||
next_to_use = 0;
|
next_to_use = 0;
|
||||||
@@ -2242,6 +2253,9 @@ static void atl1_tx_map(struct atl1_adapter *adapter, struct sk_buff *skb,
|
|||||||
page, offset,
|
page, offset,
|
||||||
buffer_info->length,
|
buffer_info->length,
|
||||||
DMA_TO_DEVICE);
|
DMA_TO_DEVICE);
|
||||||
|
if (dma_mapping_error(&adapter->pdev->dev,
|
||||||
|
buffer_info->dma))
|
||||||
|
goto dma_err;
|
||||||
if (++next_to_use == tpd_ring->count)
|
if (++next_to_use == tpd_ring->count)
|
||||||
next_to_use = 0;
|
next_to_use = 0;
|
||||||
}
|
}
|
||||||
@@ -2254,6 +2268,8 @@ static void atl1_tx_map(struct atl1_adapter *adapter, struct sk_buff *skb,
|
|||||||
buffer_info->dma = dma_map_page(&adapter->pdev->dev, page,
|
buffer_info->dma = dma_map_page(&adapter->pdev->dev, page,
|
||||||
offset, buf_len,
|
offset, buf_len,
|
||||||
DMA_TO_DEVICE);
|
DMA_TO_DEVICE);
|
||||||
|
if (dma_mapping_error(&adapter->pdev->dev, buffer_info->dma))
|
||||||
|
goto dma_err;
|
||||||
if (++next_to_use == tpd_ring->count)
|
if (++next_to_use == tpd_ring->count)
|
||||||
next_to_use = 0;
|
next_to_use = 0;
|
||||||
}
|
}
|
||||||
@@ -2277,6 +2293,9 @@ static void atl1_tx_map(struct atl1_adapter *adapter, struct sk_buff *skb,
|
|||||||
buffer_info->dma = skb_frag_dma_map(&adapter->pdev->dev,
|
buffer_info->dma = skb_frag_dma_map(&adapter->pdev->dev,
|
||||||
frag, i * ATL1_MAX_TX_BUF_LEN,
|
frag, i * ATL1_MAX_TX_BUF_LEN,
|
||||||
buffer_info->length, DMA_TO_DEVICE);
|
buffer_info->length, DMA_TO_DEVICE);
|
||||||
|
if (dma_mapping_error(&adapter->pdev->dev,
|
||||||
|
buffer_info->dma))
|
||||||
|
goto dma_err;
|
||||||
|
|
||||||
if (++next_to_use == tpd_ring->count)
|
if (++next_to_use == tpd_ring->count)
|
||||||
next_to_use = 0;
|
next_to_use = 0;
|
||||||
@@ -2285,6 +2304,22 @@ static void atl1_tx_map(struct atl1_adapter *adapter, struct sk_buff *skb,
|
|||||||
|
|
||||||
/* last tpd's buffer-info */
|
/* last tpd's buffer-info */
|
||||||
buffer_info->skb = skb;
|
buffer_info->skb = skb;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
|
||||||
|
dma_err:
|
||||||
|
while (first_mapped != next_to_use) {
|
||||||
|
buffer_info = &tpd_ring->buffer_info[first_mapped];
|
||||||
|
dma_unmap_page(&adapter->pdev->dev,
|
||||||
|
buffer_info->dma,
|
||||||
|
buffer_info->length,
|
||||||
|
DMA_TO_DEVICE);
|
||||||
|
buffer_info->dma = 0;
|
||||||
|
|
||||||
|
if (++first_mapped == tpd_ring->count)
|
||||||
|
first_mapped = 0;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void atl1_tx_queue(struct atl1_adapter *adapter, u16 count,
|
static void atl1_tx_queue(struct atl1_adapter *adapter, u16 count,
|
||||||
@@ -2355,10 +2390,8 @@ static netdev_tx_t atl1_xmit_frame(struct sk_buff *skb,
|
|||||||
|
|
||||||
len = skb_headlen(skb);
|
len = skb_headlen(skb);
|
||||||
|
|
||||||
if (unlikely(skb->len <= 0)) {
|
if (unlikely(skb->len <= 0))
|
||||||
dev_kfree_skb_any(skb);
|
goto drop_packet;
|
||||||
return NETDEV_TX_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
nr_frags = skb_shinfo(skb)->nr_frags;
|
nr_frags = skb_shinfo(skb)->nr_frags;
|
||||||
for (f = 0; f < nr_frags; f++) {
|
for (f = 0; f < nr_frags; f++) {
|
||||||
@@ -2371,10 +2404,9 @@ static netdev_tx_t atl1_xmit_frame(struct sk_buff *skb,
|
|||||||
if (mss) {
|
if (mss) {
|
||||||
if (skb->protocol == htons(ETH_P_IP)) {
|
if (skb->protocol == htons(ETH_P_IP)) {
|
||||||
proto_hdr_len = skb_tcp_all_headers(skb);
|
proto_hdr_len = skb_tcp_all_headers(skb);
|
||||||
if (unlikely(proto_hdr_len > len)) {
|
if (unlikely(proto_hdr_len > len))
|
||||||
dev_kfree_skb_any(skb);
|
goto drop_packet;
|
||||||
return NETDEV_TX_OK;
|
|
||||||
}
|
|
||||||
/* need additional TPD ? */
|
/* need additional TPD ? */
|
||||||
if (proto_hdr_len != len)
|
if (proto_hdr_len != len)
|
||||||
count += (len - proto_hdr_len +
|
count += (len - proto_hdr_len +
|
||||||
@@ -2406,23 +2438,26 @@ static netdev_tx_t atl1_xmit_frame(struct sk_buff *skb,
|
|||||||
}
|
}
|
||||||
|
|
||||||
tso = atl1_tso(adapter, skb, ptpd);
|
tso = atl1_tso(adapter, skb, ptpd);
|
||||||
if (tso < 0) {
|
if (tso < 0)
|
||||||
dev_kfree_skb_any(skb);
|
goto drop_packet;
|
||||||
return NETDEV_TX_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!tso) {
|
if (!tso) {
|
||||||
ret_val = atl1_tx_csum(adapter, skb, ptpd);
|
ret_val = atl1_tx_csum(adapter, skb, ptpd);
|
||||||
if (ret_val < 0) {
|
if (ret_val < 0)
|
||||||
dev_kfree_skb_any(skb);
|
goto drop_packet;
|
||||||
return NETDEV_TX_OK;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
atl1_tx_map(adapter, skb, ptpd);
|
if (!atl1_tx_map(adapter, skb, ptpd))
|
||||||
|
goto drop_packet;
|
||||||
|
|
||||||
atl1_tx_queue(adapter, count, ptpd);
|
atl1_tx_queue(adapter, count, ptpd);
|
||||||
atl1_update_mailbox(adapter);
|
atl1_update_mailbox(adapter);
|
||||||
return NETDEV_TX_OK;
|
return NETDEV_TX_OK;
|
||||||
|
|
||||||
|
drop_packet:
|
||||||
|
adapter->soft_stats.tx_errors++;
|
||||||
|
dev_kfree_skb_any(skb);
|
||||||
|
return NETDEV_TX_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int atl1_rings_clean(struct napi_struct *napi, int budget)
|
static int atl1_rings_clean(struct napi_struct *napi, int budget)
|
||||||
|
@@ -3928,6 +3928,7 @@ static int dpaa2_eth_setup_rx_flow(struct dpaa2_eth_priv *priv,
|
|||||||
MEM_TYPE_PAGE_ORDER0, NULL);
|
MEM_TYPE_PAGE_ORDER0, NULL);
|
||||||
if (err) {
|
if (err) {
|
||||||
dev_err(dev, "xdp_rxq_info_reg_mem_model failed\n");
|
dev_err(dev, "xdp_rxq_info_reg_mem_model failed\n");
|
||||||
|
xdp_rxq_info_unreg(&fq->channel->xdp_rxq);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4421,17 +4422,25 @@ static int dpaa2_eth_bind_dpni(struct dpaa2_eth_priv *priv)
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
err = dpni_get_qdid(priv->mc_io, 0, priv->mc_token,
|
err = dpni_get_qdid(priv->mc_io, 0, priv->mc_token,
|
||||||
DPNI_QUEUE_TX, &priv->tx_qdid);
|
DPNI_QUEUE_TX, &priv->tx_qdid);
|
||||||
if (err) {
|
if (err) {
|
||||||
dev_err(dev, "dpni_get_qdid() failed\n");
|
dev_err(dev, "dpni_get_qdid() failed\n");
|
||||||
return err;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
out:
|
||||||
|
while (i--) {
|
||||||
|
if (priv->fq[i].type == DPAA2_RX_FQ &&
|
||||||
|
xdp_rxq_info_is_reg(&priv->fq[i].channel->xdp_rxq))
|
||||||
|
xdp_rxq_info_unreg(&priv->fq[i].channel->xdp_rxq);
|
||||||
|
}
|
||||||
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Allocate rings for storing incoming frame descriptors */
|
/* Allocate rings for storing incoming frame descriptors */
|
||||||
@@ -4813,6 +4822,17 @@ static void dpaa2_eth_del_ch_napi(struct dpaa2_eth_priv *priv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void dpaa2_eth_free_rx_xdp_rxq(struct dpaa2_eth_priv *priv)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < priv->num_fqs; i++) {
|
||||||
|
if (priv->fq[i].type == DPAA2_RX_FQ &&
|
||||||
|
xdp_rxq_info_is_reg(&priv->fq[i].channel->xdp_rxq))
|
||||||
|
xdp_rxq_info_unreg(&priv->fq[i].channel->xdp_rxq);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static int dpaa2_eth_probe(struct fsl_mc_device *dpni_dev)
|
static int dpaa2_eth_probe(struct fsl_mc_device *dpni_dev)
|
||||||
{
|
{
|
||||||
struct device *dev;
|
struct device *dev;
|
||||||
@@ -5016,6 +5036,7 @@ err_alloc_percpu_extras:
|
|||||||
free_percpu(priv->percpu_stats);
|
free_percpu(priv->percpu_stats);
|
||||||
err_alloc_percpu_stats:
|
err_alloc_percpu_stats:
|
||||||
dpaa2_eth_del_ch_napi(priv);
|
dpaa2_eth_del_ch_napi(priv);
|
||||||
|
dpaa2_eth_free_rx_xdp_rxq(priv);
|
||||||
err_bind:
|
err_bind:
|
||||||
dpaa2_eth_free_dpbps(priv);
|
dpaa2_eth_free_dpbps(priv);
|
||||||
err_dpbp_setup:
|
err_dpbp_setup:
|
||||||
@@ -5068,6 +5089,7 @@ static void dpaa2_eth_remove(struct fsl_mc_device *ls_dev)
|
|||||||
free_percpu(priv->percpu_extras);
|
free_percpu(priv->percpu_extras);
|
||||||
|
|
||||||
dpaa2_eth_del_ch_napi(priv);
|
dpaa2_eth_del_ch_napi(priv);
|
||||||
|
dpaa2_eth_free_rx_xdp_rxq(priv);
|
||||||
dpaa2_eth_free_dpbps(priv);
|
dpaa2_eth_free_dpbps(priv);
|
||||||
dpaa2_eth_free_dpio(priv);
|
dpaa2_eth_free_dpio(priv);
|
||||||
dpaa2_eth_free_dpni(priv);
|
dpaa2_eth_free_dpni(priv);
|
||||||
|
@@ -487,6 +487,26 @@ static unsigned int mergeable_ctx_to_truesize(void *mrg_ctx)
|
|||||||
return (unsigned long)mrg_ctx & ((1 << MRG_CTX_HEADER_SHIFT) - 1);
|
return (unsigned long)mrg_ctx & ((1 << MRG_CTX_HEADER_SHIFT) - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int check_mergeable_len(struct net_device *dev, void *mrg_ctx,
|
||||||
|
unsigned int len)
|
||||||
|
{
|
||||||
|
unsigned int headroom, tailroom, room, truesize;
|
||||||
|
|
||||||
|
truesize = mergeable_ctx_to_truesize(mrg_ctx);
|
||||||
|
headroom = mergeable_ctx_to_headroom(mrg_ctx);
|
||||||
|
tailroom = headroom ? sizeof(struct skb_shared_info) : 0;
|
||||||
|
room = SKB_DATA_ALIGN(headroom + tailroom);
|
||||||
|
|
||||||
|
if (len > truesize - room) {
|
||||||
|
pr_debug("%s: rx error: len %u exceeds truesize %lu\n",
|
||||||
|
dev->name, len, (unsigned long)(truesize - room));
|
||||||
|
DEV_STATS_INC(dev, rx_length_errors);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static struct sk_buff *virtnet_build_skb(void *buf, unsigned int buflen,
|
static struct sk_buff *virtnet_build_skb(void *buf, unsigned int buflen,
|
||||||
unsigned int headroom,
|
unsigned int headroom,
|
||||||
unsigned int len)
|
unsigned int len)
|
||||||
@@ -1084,7 +1104,8 @@ static unsigned int virtnet_get_headroom(struct virtnet_info *vi)
|
|||||||
* across multiple buffers (num_buf > 1), and we make sure buffers
|
* across multiple buffers (num_buf > 1), and we make sure buffers
|
||||||
* have enough headroom.
|
* have enough headroom.
|
||||||
*/
|
*/
|
||||||
static struct page *xdp_linearize_page(struct receive_queue *rq,
|
static struct page *xdp_linearize_page(struct net_device *dev,
|
||||||
|
struct receive_queue *rq,
|
||||||
int *num_buf,
|
int *num_buf,
|
||||||
struct page *p,
|
struct page *p,
|
||||||
int offset,
|
int offset,
|
||||||
@@ -1104,18 +1125,27 @@ static struct page *xdp_linearize_page(struct receive_queue *rq,
|
|||||||
memcpy(page_address(page) + page_off, page_address(p) + offset, *len);
|
memcpy(page_address(page) + page_off, page_address(p) + offset, *len);
|
||||||
page_off += *len;
|
page_off += *len;
|
||||||
|
|
||||||
|
/* Only mergeable mode can go inside this while loop. In small mode,
|
||||||
|
* *num_buf == 1, so it cannot go inside.
|
||||||
|
*/
|
||||||
while (--*num_buf) {
|
while (--*num_buf) {
|
||||||
unsigned int buflen;
|
unsigned int buflen;
|
||||||
void *buf;
|
void *buf;
|
||||||
|
void *ctx;
|
||||||
int off;
|
int off;
|
||||||
|
|
||||||
buf = virtnet_rq_get_buf(rq, &buflen, NULL);
|
buf = virtnet_rq_get_buf(rq, &buflen, &ctx);
|
||||||
if (unlikely(!buf))
|
if (unlikely(!buf))
|
||||||
goto err_buf;
|
goto err_buf;
|
||||||
|
|
||||||
p = virt_to_head_page(buf);
|
p = virt_to_head_page(buf);
|
||||||
off = buf - page_address(p);
|
off = buf - page_address(p);
|
||||||
|
|
||||||
|
if (check_mergeable_len(dev, ctx, buflen)) {
|
||||||
|
put_page(p);
|
||||||
|
goto err_buf;
|
||||||
|
}
|
||||||
|
|
||||||
/* guard against a misconfigured or uncooperative backend that
|
/* guard against a misconfigured or uncooperative backend that
|
||||||
* is sending packet larger than the MTU.
|
* is sending packet larger than the MTU.
|
||||||
*/
|
*/
|
||||||
@@ -1204,7 +1234,7 @@ static struct sk_buff *receive_small_xdp(struct net_device *dev,
|
|||||||
headroom = vi->hdr_len + header_offset;
|
headroom = vi->hdr_len + header_offset;
|
||||||
buflen = SKB_DATA_ALIGN(GOOD_PACKET_LEN + headroom) +
|
buflen = SKB_DATA_ALIGN(GOOD_PACKET_LEN + headroom) +
|
||||||
SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
|
SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
|
||||||
xdp_page = xdp_linearize_page(rq, &num_buf, page,
|
xdp_page = xdp_linearize_page(dev, rq, &num_buf, page,
|
||||||
offset, header_offset,
|
offset, header_offset,
|
||||||
&tlen);
|
&tlen);
|
||||||
if (!xdp_page)
|
if (!xdp_page)
|
||||||
@@ -1539,7 +1569,7 @@ static void *mergeable_xdp_get_buf(struct virtnet_info *vi,
|
|||||||
*/
|
*/
|
||||||
if (!xdp_prog->aux->xdp_has_frags) {
|
if (!xdp_prog->aux->xdp_has_frags) {
|
||||||
/* linearize data for XDP */
|
/* linearize data for XDP */
|
||||||
xdp_page = xdp_linearize_page(rq, num_buf,
|
xdp_page = xdp_linearize_page(vi->dev, rq, num_buf,
|
||||||
*page, offset,
|
*page, offset,
|
||||||
VIRTIO_XDP_HEADROOM,
|
VIRTIO_XDP_HEADROOM,
|
||||||
len);
|
len);
|
||||||
|
@@ -281,7 +281,8 @@ static int mlxbf_tmfifo_alloc_vrings(struct mlxbf_tmfifo *fifo,
|
|||||||
vring->align = SMP_CACHE_BYTES;
|
vring->align = SMP_CACHE_BYTES;
|
||||||
vring->index = i;
|
vring->index = i;
|
||||||
vring->vdev_id = tm_vdev->vdev.id.device;
|
vring->vdev_id = tm_vdev->vdev.id.device;
|
||||||
vring->drop_desc.len = VRING_DROP_DESC_MAX_LEN;
|
vring->drop_desc.len = cpu_to_virtio32(&tm_vdev->vdev,
|
||||||
|
VRING_DROP_DESC_MAX_LEN);
|
||||||
dev = &tm_vdev->vdev.dev;
|
dev = &tm_vdev->vdev.dev;
|
||||||
|
|
||||||
size = vring_size(vring->num, vring->align);
|
size = vring_size(vring->num, vring->align);
|
||||||
|
@@ -688,7 +688,7 @@ static int mlxreg_lc_completion_notify(void *handle, struct i2c_adapter *parent,
|
|||||||
if (regval & mlxreg_lc->data->mask) {
|
if (regval & mlxreg_lc->data->mask) {
|
||||||
mlxreg_lc->state |= MLXREG_LC_SYNCED;
|
mlxreg_lc->state |= MLXREG_LC_SYNCED;
|
||||||
mlxreg_lc_state_update_locked(mlxreg_lc, MLXREG_LC_SYNCED, 1);
|
mlxreg_lc_state_update_locked(mlxreg_lc, MLXREG_LC_SYNCED, 1);
|
||||||
if (mlxreg_lc->state & ~MLXREG_LC_POWERED) {
|
if (!(mlxreg_lc->state & MLXREG_LC_POWERED)) {
|
||||||
err = mlxreg_lc_power_on_off(mlxreg_lc, 1);
|
err = mlxreg_lc_power_on_off(mlxreg_lc, 1);
|
||||||
if (err)
|
if (err)
|
||||||
goto mlxreg_lc_regmap_power_on_off_fail;
|
goto mlxreg_lc_regmap_power_on_off_fail;
|
||||||
|
@@ -1088,7 +1088,7 @@ static int nvsw_sn2201_i2c_completion_notify(void *handle, int id)
|
|||||||
if (!nvsw_sn2201->main_mux_devs->adapter) {
|
if (!nvsw_sn2201->main_mux_devs->adapter) {
|
||||||
err = -ENODEV;
|
err = -ENODEV;
|
||||||
dev_err(nvsw_sn2201->dev, "Failed to get adapter for bus %d\n",
|
dev_err(nvsw_sn2201->dev, "Failed to get adapter for bus %d\n",
|
||||||
nvsw_sn2201->cpld_devs->nr);
|
nvsw_sn2201->main_mux_devs->nr);
|
||||||
goto i2c_get_adapter_main_fail;
|
goto i2c_get_adapter_main_fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -89,6 +89,11 @@ extern struct wmi_sysman_priv wmi_priv;
|
|||||||
|
|
||||||
enum { ENUM, INT, STR, PO };
|
enum { ENUM, INT, STR, PO };
|
||||||
|
|
||||||
|
#define ENUM_MIN_ELEMENTS 8
|
||||||
|
#define INT_MIN_ELEMENTS 9
|
||||||
|
#define STR_MIN_ELEMENTS 8
|
||||||
|
#define PO_MIN_ELEMENTS 4
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
ATTR_NAME,
|
ATTR_NAME,
|
||||||
DISPL_NAME_LANG_CODE,
|
DISPL_NAME_LANG_CODE,
|
||||||
|
@@ -23,9 +23,10 @@ static ssize_t current_value_show(struct kobject *kobj, struct kobj_attribute *a
|
|||||||
obj = get_wmiobj_pointer(instance_id, DELL_WMI_BIOS_ENUMERATION_ATTRIBUTE_GUID);
|
obj = get_wmiobj_pointer(instance_id, DELL_WMI_BIOS_ENUMERATION_ATTRIBUTE_GUID);
|
||||||
if (!obj)
|
if (!obj)
|
||||||
return -EIO;
|
return -EIO;
|
||||||
if (obj->package.elements[CURRENT_VAL].type != ACPI_TYPE_STRING) {
|
if (obj->type != ACPI_TYPE_PACKAGE || obj->package.count < ENUM_MIN_ELEMENTS ||
|
||||||
|
obj->package.elements[CURRENT_VAL].type != ACPI_TYPE_STRING) {
|
||||||
kfree(obj);
|
kfree(obj);
|
||||||
return -EINVAL;
|
return -EIO;
|
||||||
}
|
}
|
||||||
ret = snprintf(buf, PAGE_SIZE, "%s\n", obj->package.elements[CURRENT_VAL].string.pointer);
|
ret = snprintf(buf, PAGE_SIZE, "%s\n", obj->package.elements[CURRENT_VAL].string.pointer);
|
||||||
kfree(obj);
|
kfree(obj);
|
||||||
|
@@ -25,9 +25,10 @@ static ssize_t current_value_show(struct kobject *kobj, struct kobj_attribute *a
|
|||||||
obj = get_wmiobj_pointer(instance_id, DELL_WMI_BIOS_INTEGER_ATTRIBUTE_GUID);
|
obj = get_wmiobj_pointer(instance_id, DELL_WMI_BIOS_INTEGER_ATTRIBUTE_GUID);
|
||||||
if (!obj)
|
if (!obj)
|
||||||
return -EIO;
|
return -EIO;
|
||||||
if (obj->package.elements[CURRENT_VAL].type != ACPI_TYPE_INTEGER) {
|
if (obj->type != ACPI_TYPE_PACKAGE || obj->package.count < INT_MIN_ELEMENTS ||
|
||||||
|
obj->package.elements[CURRENT_VAL].type != ACPI_TYPE_INTEGER) {
|
||||||
kfree(obj);
|
kfree(obj);
|
||||||
return -EINVAL;
|
return -EIO;
|
||||||
}
|
}
|
||||||
ret = snprintf(buf, PAGE_SIZE, "%lld\n", obj->package.elements[CURRENT_VAL].integer.value);
|
ret = snprintf(buf, PAGE_SIZE, "%lld\n", obj->package.elements[CURRENT_VAL].integer.value);
|
||||||
kfree(obj);
|
kfree(obj);
|
||||||
|
@@ -26,9 +26,10 @@ static ssize_t is_enabled_show(struct kobject *kobj, struct kobj_attribute *attr
|
|||||||
obj = get_wmiobj_pointer(instance_id, DELL_WMI_BIOS_PASSOBJ_ATTRIBUTE_GUID);
|
obj = get_wmiobj_pointer(instance_id, DELL_WMI_BIOS_PASSOBJ_ATTRIBUTE_GUID);
|
||||||
if (!obj)
|
if (!obj)
|
||||||
return -EIO;
|
return -EIO;
|
||||||
if (obj->package.elements[IS_PASS_SET].type != ACPI_TYPE_INTEGER) {
|
if (obj->type != ACPI_TYPE_PACKAGE || obj->package.count < PO_MIN_ELEMENTS ||
|
||||||
|
obj->package.elements[IS_PASS_SET].type != ACPI_TYPE_INTEGER) {
|
||||||
kfree(obj);
|
kfree(obj);
|
||||||
return -EINVAL;
|
return -EIO;
|
||||||
}
|
}
|
||||||
ret = snprintf(buf, PAGE_SIZE, "%lld\n", obj->package.elements[IS_PASS_SET].integer.value);
|
ret = snprintf(buf, PAGE_SIZE, "%lld\n", obj->package.elements[IS_PASS_SET].integer.value);
|
||||||
kfree(obj);
|
kfree(obj);
|
||||||
|
@@ -25,9 +25,10 @@ static ssize_t current_value_show(struct kobject *kobj, struct kobj_attribute *a
|
|||||||
obj = get_wmiobj_pointer(instance_id, DELL_WMI_BIOS_STRING_ATTRIBUTE_GUID);
|
obj = get_wmiobj_pointer(instance_id, DELL_WMI_BIOS_STRING_ATTRIBUTE_GUID);
|
||||||
if (!obj)
|
if (!obj)
|
||||||
return -EIO;
|
return -EIO;
|
||||||
if (obj->package.elements[CURRENT_VAL].type != ACPI_TYPE_STRING) {
|
if (obj->type != ACPI_TYPE_PACKAGE || obj->package.count < STR_MIN_ELEMENTS ||
|
||||||
|
obj->package.elements[CURRENT_VAL].type != ACPI_TYPE_STRING) {
|
||||||
kfree(obj);
|
kfree(obj);
|
||||||
return -EINVAL;
|
return -EIO;
|
||||||
}
|
}
|
||||||
ret = snprintf(buf, PAGE_SIZE, "%s\n", obj->package.elements[CURRENT_VAL].string.pointer);
|
ret = snprintf(buf, PAGE_SIZE, "%s\n", obj->package.elements[CURRENT_VAL].string.pointer);
|
||||||
kfree(obj);
|
kfree(obj);
|
||||||
|
@@ -25,7 +25,6 @@ struct wmi_sysman_priv wmi_priv = {
|
|||||||
/* reset bios to defaults */
|
/* reset bios to defaults */
|
||||||
static const char * const reset_types[] = {"builtinsafe", "lastknowngood", "factory", "custom"};
|
static const char * const reset_types[] = {"builtinsafe", "lastknowngood", "factory", "custom"};
|
||||||
static int reset_option = -1;
|
static int reset_option = -1;
|
||||||
static struct class *fw_attr_class;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -408,10 +407,10 @@ static int init_bios_attributes(int attr_type, const char *guid)
|
|||||||
return retval;
|
return retval;
|
||||||
|
|
||||||
switch (attr_type) {
|
switch (attr_type) {
|
||||||
case ENUM: min_elements = 8; break;
|
case ENUM: min_elements = ENUM_MIN_ELEMENTS; break;
|
||||||
case INT: min_elements = 9; break;
|
case INT: min_elements = INT_MIN_ELEMENTS; break;
|
||||||
case STR: min_elements = 8; break;
|
case STR: min_elements = STR_MIN_ELEMENTS; break;
|
||||||
case PO: min_elements = 4; break;
|
case PO: min_elements = PO_MIN_ELEMENTS; break;
|
||||||
default:
|
default:
|
||||||
pr_err("Error: Unknown attr_type: %d\n", attr_type);
|
pr_err("Error: Unknown attr_type: %d\n", attr_type);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
@@ -541,15 +540,11 @@ static int __init sysman_init(void)
|
|||||||
goto err_exit_bios_attr_pass_interface;
|
goto err_exit_bios_attr_pass_interface;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = fw_attributes_class_get(&fw_attr_class);
|
wmi_priv.class_dev = device_create(&firmware_attributes_class, NULL, MKDEV(0, 0),
|
||||||
if (ret)
|
|
||||||
goto err_exit_bios_attr_pass_interface;
|
|
||||||
|
|
||||||
wmi_priv.class_dev = device_create(fw_attr_class, NULL, MKDEV(0, 0),
|
|
||||||
NULL, "%s", DRIVER_NAME);
|
NULL, "%s", DRIVER_NAME);
|
||||||
if (IS_ERR(wmi_priv.class_dev)) {
|
if (IS_ERR(wmi_priv.class_dev)) {
|
||||||
ret = PTR_ERR(wmi_priv.class_dev);
|
ret = PTR_ERR(wmi_priv.class_dev);
|
||||||
goto err_unregister_class;
|
goto err_exit_bios_attr_pass_interface;
|
||||||
}
|
}
|
||||||
|
|
||||||
wmi_priv.main_dir_kset = kset_create_and_add("attributes", NULL,
|
wmi_priv.main_dir_kset = kset_create_and_add("attributes", NULL,
|
||||||
@@ -602,10 +597,7 @@ err_release_attributes_data:
|
|||||||
release_attributes_data();
|
release_attributes_data();
|
||||||
|
|
||||||
err_destroy_classdev:
|
err_destroy_classdev:
|
||||||
device_destroy(fw_attr_class, MKDEV(0, 0));
|
device_unregister(wmi_priv.class_dev);
|
||||||
|
|
||||||
err_unregister_class:
|
|
||||||
fw_attributes_class_put();
|
|
||||||
|
|
||||||
err_exit_bios_attr_pass_interface:
|
err_exit_bios_attr_pass_interface:
|
||||||
exit_bios_attr_pass_interface();
|
exit_bios_attr_pass_interface();
|
||||||
@@ -619,8 +611,7 @@ err_exit_bios_attr_set_interface:
|
|||||||
static void __exit sysman_exit(void)
|
static void __exit sysman_exit(void)
|
||||||
{
|
{
|
||||||
release_attributes_data();
|
release_attributes_data();
|
||||||
device_destroy(fw_attr_class, MKDEV(0, 0));
|
device_unregister(wmi_priv.class_dev);
|
||||||
fw_attributes_class_put();
|
|
||||||
exit_bios_attr_set_interface();
|
exit_bios_attr_set_interface();
|
||||||
exit_bios_attr_pass_interface();
|
exit_bios_attr_pass_interface();
|
||||||
}
|
}
|
||||||
|
@@ -2,48 +2,35 @@
|
|||||||
|
|
||||||
/* Firmware attributes class helper module */
|
/* Firmware attributes class helper module */
|
||||||
|
|
||||||
#include <linux/mutex.h>
|
|
||||||
#include <linux/device/class.h>
|
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include "firmware_attributes_class.h"
|
#include "firmware_attributes_class.h"
|
||||||
|
|
||||||
static DEFINE_MUTEX(fw_attr_lock);
|
const struct class firmware_attributes_class = {
|
||||||
static int fw_attr_inuse;
|
|
||||||
|
|
||||||
static struct class firmware_attributes_class = {
|
|
||||||
.name = "firmware-attributes",
|
.name = "firmware-attributes",
|
||||||
};
|
};
|
||||||
|
EXPORT_SYMBOL_GPL(firmware_attributes_class);
|
||||||
|
|
||||||
int fw_attributes_class_get(struct class **fw_attr_class)
|
static __init int fw_attributes_class_init(void)
|
||||||
{
|
{
|
||||||
int err;
|
return class_register(&firmware_attributes_class);
|
||||||
|
}
|
||||||
|
module_init(fw_attributes_class_init);
|
||||||
|
|
||||||
mutex_lock(&fw_attr_lock);
|
static __exit void fw_attributes_class_exit(void)
|
||||||
if (!fw_attr_inuse) { /*first time class is being used*/
|
{
|
||||||
err = class_register(&firmware_attributes_class);
|
class_unregister(&firmware_attributes_class);
|
||||||
if (err) {
|
}
|
||||||
mutex_unlock(&fw_attr_lock);
|
module_exit(fw_attributes_class_exit);
|
||||||
return err;
|
|
||||||
}
|
int fw_attributes_class_get(const struct class **fw_attr_class)
|
||||||
}
|
{
|
||||||
fw_attr_inuse++;
|
|
||||||
*fw_attr_class = &firmware_attributes_class;
|
*fw_attr_class = &firmware_attributes_class;
|
||||||
mutex_unlock(&fw_attr_lock);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(fw_attributes_class_get);
|
EXPORT_SYMBOL_GPL(fw_attributes_class_get);
|
||||||
|
|
||||||
int fw_attributes_class_put(void)
|
int fw_attributes_class_put(void)
|
||||||
{
|
{
|
||||||
mutex_lock(&fw_attr_lock);
|
|
||||||
if (!fw_attr_inuse) {
|
|
||||||
mutex_unlock(&fw_attr_lock);
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
fw_attr_inuse--;
|
|
||||||
if (!fw_attr_inuse) /* No more consumers */
|
|
||||||
class_unregister(&firmware_attributes_class);
|
|
||||||
mutex_unlock(&fw_attr_lock);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(fw_attributes_class_put);
|
EXPORT_SYMBOL_GPL(fw_attributes_class_put);
|
||||||
|
@@ -5,7 +5,10 @@
|
|||||||
#ifndef FW_ATTR_CLASS_H
|
#ifndef FW_ATTR_CLASS_H
|
||||||
#define FW_ATTR_CLASS_H
|
#define FW_ATTR_CLASS_H
|
||||||
|
|
||||||
int fw_attributes_class_get(struct class **fw_attr_class);
|
#include <linux/device/class.h>
|
||||||
|
|
||||||
|
extern const struct class firmware_attributes_class;
|
||||||
|
int fw_attributes_class_get(const struct class **fw_attr_class);
|
||||||
int fw_attributes_class_put(void);
|
int fw_attributes_class_put(void);
|
||||||
|
|
||||||
#endif /* FW_ATTR_CLASS_H */
|
#endif /* FW_ATTR_CLASS_H */
|
||||||
|
@@ -24,7 +24,7 @@ struct bioscfg_priv bioscfg_drv = {
|
|||||||
.mutex = __MUTEX_INITIALIZER(bioscfg_drv.mutex),
|
.mutex = __MUTEX_INITIALIZER(bioscfg_drv.mutex),
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct class *fw_attr_class;
|
static const struct class *fw_attr_class;
|
||||||
|
|
||||||
ssize_t display_name_language_code_show(struct kobject *kobj,
|
ssize_t display_name_language_code_show(struct kobject *kobj,
|
||||||
struct kobj_attribute *attr,
|
struct kobj_attribute *attr,
|
||||||
|
@@ -195,7 +195,6 @@ static const char * const level_options[] = {
|
|||||||
[TLMI_LEVEL_MASTER] = "master",
|
[TLMI_LEVEL_MASTER] = "master",
|
||||||
};
|
};
|
||||||
static struct think_lmi tlmi_priv;
|
static struct think_lmi tlmi_priv;
|
||||||
static struct class *fw_attr_class;
|
|
||||||
static DEFINE_MUTEX(tlmi_mutex);
|
static DEFINE_MUTEX(tlmi_mutex);
|
||||||
|
|
||||||
/* ------ Utility functions ------------*/
|
/* ------ Utility functions ------------*/
|
||||||
@@ -1272,11 +1271,7 @@ static int tlmi_sysfs_init(void)
|
|||||||
{
|
{
|
||||||
int i, ret;
|
int i, ret;
|
||||||
|
|
||||||
ret = fw_attributes_class_get(&fw_attr_class);
|
tlmi_priv.class_dev = device_create(&firmware_attributes_class, NULL, MKDEV(0, 0),
|
||||||
if (ret)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
tlmi_priv.class_dev = device_create(fw_attr_class, NULL, MKDEV(0, 0),
|
|
||||||
NULL, "%s", "thinklmi");
|
NULL, "%s", "thinklmi");
|
||||||
if (IS_ERR(tlmi_priv.class_dev)) {
|
if (IS_ERR(tlmi_priv.class_dev)) {
|
||||||
ret = PTR_ERR(tlmi_priv.class_dev);
|
ret = PTR_ERR(tlmi_priv.class_dev);
|
||||||
@@ -1385,9 +1380,8 @@ static int tlmi_sysfs_init(void)
|
|||||||
fail_create_attr:
|
fail_create_attr:
|
||||||
tlmi_release_attr();
|
tlmi_release_attr();
|
||||||
fail_device_created:
|
fail_device_created:
|
||||||
device_destroy(fw_attr_class, MKDEV(0, 0));
|
device_unregister(tlmi_priv.class_dev);
|
||||||
fail_class_created:
|
fail_class_created:
|
||||||
fw_attributes_class_put();
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1610,8 +1604,7 @@ fail_clear_attr:
|
|||||||
static void tlmi_remove(struct wmi_device *wdev)
|
static void tlmi_remove(struct wmi_device *wdev)
|
||||||
{
|
{
|
||||||
tlmi_release_attr();
|
tlmi_release_attr();
|
||||||
device_destroy(fw_attr_class, MKDEV(0, 0));
|
device_unregister(tlmi_priv.class_dev);
|
||||||
fw_attributes_class_put();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int tlmi_probe(struct wmi_device *wdev, const void *context)
|
static int tlmi_probe(struct wmi_device *wdev, const void *context)
|
||||||
|
@@ -260,8 +260,10 @@ static int gpio_regulator_probe(struct platform_device *pdev)
|
|||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
drvdata->gpiods = devm_kzalloc(dev, sizeof(struct gpio_desc *),
|
drvdata->gpiods = devm_kcalloc(dev, config->ngpios,
|
||||||
GFP_KERNEL);
|
sizeof(struct gpio_desc *), GFP_KERNEL);
|
||||||
|
if (!drvdata->gpiods)
|
||||||
|
return -ENOMEM;
|
||||||
|
|
||||||
if (config->input_supply) {
|
if (config->input_supply) {
|
||||||
drvdata->desc.supply_name = devm_kstrdup(&pdev->dev,
|
drvdata->desc.supply_name = devm_kstrdup(&pdev->dev,
|
||||||
@@ -274,8 +276,6 @@ static int gpio_regulator_probe(struct platform_device *pdev)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!drvdata->gpiods)
|
|
||||||
return -ENOMEM;
|
|
||||||
for (i = 0; i < config->ngpios; i++) {
|
for (i = 0; i < config->ngpios; i++) {
|
||||||
drvdata->gpiods[i] = devm_gpiod_get_index(dev,
|
drvdata->gpiods[i] = devm_gpiod_get_index(dev,
|
||||||
NULL,
|
NULL,
|
||||||
|
@@ -697,8 +697,12 @@ static irqreturn_t cmos_interrupt(int irq, void *p)
|
|||||||
{
|
{
|
||||||
u8 irqstat;
|
u8 irqstat;
|
||||||
u8 rtc_control;
|
u8 rtc_control;
|
||||||
|
unsigned long flags;
|
||||||
|
|
||||||
spin_lock(&rtc_lock);
|
/* We cannot use spin_lock() here, as cmos_interrupt() is also called
|
||||||
|
* in a non-irq context.
|
||||||
|
*/
|
||||||
|
spin_lock_irqsave(&rtc_lock, flags);
|
||||||
|
|
||||||
/* When the HPET interrupt handler calls us, the interrupt
|
/* When the HPET interrupt handler calls us, the interrupt
|
||||||
* status is passed as arg1 instead of the irq number. But
|
* status is passed as arg1 instead of the irq number. But
|
||||||
@@ -732,7 +736,7 @@ static irqreturn_t cmos_interrupt(int irq, void *p)
|
|||||||
hpet_mask_rtc_irq_bit(RTC_AIE);
|
hpet_mask_rtc_irq_bit(RTC_AIE);
|
||||||
CMOS_READ(RTC_INTR_FLAGS);
|
CMOS_READ(RTC_INTR_FLAGS);
|
||||||
}
|
}
|
||||||
spin_unlock(&rtc_lock);
|
spin_unlock_irqrestore(&rtc_lock, flags);
|
||||||
|
|
||||||
if (is_intr(irqstat)) {
|
if (is_intr(irqstat)) {
|
||||||
rtc_update_irq(p, 1, irqstat);
|
rtc_update_irq(p, 1, irqstat);
|
||||||
@@ -1300,9 +1304,7 @@ static void cmos_check_wkalrm(struct device *dev)
|
|||||||
* ACK the rtc irq here
|
* ACK the rtc irq here
|
||||||
*/
|
*/
|
||||||
if (t_now >= cmos->alarm_expires && cmos_use_acpi_alarm()) {
|
if (t_now >= cmos->alarm_expires && cmos_use_acpi_alarm()) {
|
||||||
local_irq_disable();
|
|
||||||
cmos_interrupt(0, (void *)cmos->rtc);
|
cmos_interrupt(0, (void *)cmos->rtc);
|
||||||
local_irq_enable();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1383,6 +1383,11 @@ static int pcf2127_i2c_probe(struct i2c_client *client)
|
|||||||
variant = &pcf21xx_cfg[type];
|
variant = &pcf21xx_cfg[type];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (variant->type == PCF2131) {
|
||||||
|
config.read_flag_mask = 0x0;
|
||||||
|
config.write_flag_mask = 0x0;
|
||||||
|
}
|
||||||
|
|
||||||
config.max_register = variant->max_register,
|
config.max_register = variant->max_register,
|
||||||
|
|
||||||
regmap = devm_regmap_init(&client->dev, &pcf2127_i2c_regmap,
|
regmap = devm_regmap_init(&client->dev, &pcf2127_i2c_regmap,
|
||||||
@@ -1456,7 +1461,7 @@ static int pcf2127_spi_probe(struct spi_device *spi)
|
|||||||
variant = &pcf21xx_cfg[type];
|
variant = &pcf21xx_cfg[type];
|
||||||
}
|
}
|
||||||
|
|
||||||
config.max_register = variant->max_register,
|
config.max_register = variant->max_register;
|
||||||
|
|
||||||
regmap = devm_regmap_init_spi(spi, &config);
|
regmap = devm_regmap_init_spi(spi, &config);
|
||||||
if (IS_ERR(regmap)) {
|
if (IS_ERR(regmap)) {
|
||||||
|
@@ -2147,7 +2147,7 @@ qla24xx_get_port_database(scsi_qla_host_t *vha, u16 nport_handle,
|
|||||||
|
|
||||||
pdb_dma = dma_map_single(&vha->hw->pdev->dev, pdb,
|
pdb_dma = dma_map_single(&vha->hw->pdev->dev, pdb,
|
||||||
sizeof(*pdb), DMA_FROM_DEVICE);
|
sizeof(*pdb), DMA_FROM_DEVICE);
|
||||||
if (!pdb_dma) {
|
if (dma_mapping_error(&vha->hw->pdev->dev, pdb_dma)) {
|
||||||
ql_log(ql_log_warn, vha, 0x1116, "Failed to map dma buffer.\n");
|
ql_log(ql_log_warn, vha, 0x1116, "Failed to map dma buffer.\n");
|
||||||
return QLA_MEMORY_ALLOC_FAILED;
|
return QLA_MEMORY_ALLOC_FAILED;
|
||||||
}
|
}
|
||||||
|
@@ -3420,6 +3420,8 @@ static int qla4xxx_alloc_pdu(struct iscsi_task *task, uint8_t opcode)
|
|||||||
task_data->data_dma = dma_map_single(&ha->pdev->dev, task->data,
|
task_data->data_dma = dma_map_single(&ha->pdev->dev, task->data,
|
||||||
task->data_count,
|
task->data_count,
|
||||||
DMA_TO_DEVICE);
|
DMA_TO_DEVICE);
|
||||||
|
if (dma_mapping_error(&ha->pdev->dev, task_data->data_dma))
|
||||||
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEBUG2(ql4_printk(KERN_INFO, ha, "%s: MaxRecvLen %u, iscsi hrd %d\n",
|
DEBUG2(ql4_printk(KERN_INFO, ha, "%s: MaxRecvLen %u, iscsi hrd %d\n",
|
||||||
|
@@ -988,11 +988,20 @@ static int dspi_transfer_one_message(struct spi_controller *ctlr,
|
|||||||
if (dspi->devtype_data->trans_mode == DSPI_DMA_MODE) {
|
if (dspi->devtype_data->trans_mode == DSPI_DMA_MODE) {
|
||||||
status = dspi_dma_xfer(dspi);
|
status = dspi_dma_xfer(dspi);
|
||||||
} else {
|
} else {
|
||||||
|
/*
|
||||||
|
* Reinitialize the completion before transferring data
|
||||||
|
* to avoid the case where it might remain in the done
|
||||||
|
* state due to a spurious interrupt from a previous
|
||||||
|
* transfer. This could falsely signal that the current
|
||||||
|
* transfer has completed.
|
||||||
|
*/
|
||||||
|
if (dspi->irq)
|
||||||
|
reinit_completion(&dspi->xfer_done);
|
||||||
|
|
||||||
dspi_fifo_write(dspi);
|
dspi_fifo_write(dspi);
|
||||||
|
|
||||||
if (dspi->irq) {
|
if (dspi->irq) {
|
||||||
wait_for_completion(&dspi->xfer_done);
|
wait_for_completion(&dspi->xfer_done);
|
||||||
reinit_completion(&dspi->xfer_done);
|
|
||||||
} else {
|
} else {
|
||||||
do {
|
do {
|
||||||
status = dspi_poll(dspi);
|
status = dspi_poll(dspi);
|
||||||
|
@@ -1348,7 +1348,7 @@ UFS_UNIT_DESC_PARAM(logical_block_size, _LOGICAL_BLK_SIZE, 1);
|
|||||||
UFS_UNIT_DESC_PARAM(logical_block_count, _LOGICAL_BLK_COUNT, 8);
|
UFS_UNIT_DESC_PARAM(logical_block_count, _LOGICAL_BLK_COUNT, 8);
|
||||||
UFS_UNIT_DESC_PARAM(erase_block_size, _ERASE_BLK_SIZE, 4);
|
UFS_UNIT_DESC_PARAM(erase_block_size, _ERASE_BLK_SIZE, 4);
|
||||||
UFS_UNIT_DESC_PARAM(provisioning_type, _PROVISIONING_TYPE, 1);
|
UFS_UNIT_DESC_PARAM(provisioning_type, _PROVISIONING_TYPE, 1);
|
||||||
UFS_UNIT_DESC_PARAM(physical_memory_resourse_count, _PHY_MEM_RSRC_CNT, 8);
|
UFS_UNIT_DESC_PARAM(physical_memory_resource_count, _PHY_MEM_RSRC_CNT, 8);
|
||||||
UFS_UNIT_DESC_PARAM(context_capabilities, _CTX_CAPABILITIES, 2);
|
UFS_UNIT_DESC_PARAM(context_capabilities, _CTX_CAPABILITIES, 2);
|
||||||
UFS_UNIT_DESC_PARAM(large_unit_granularity, _LARGE_UNIT_SIZE_M1, 1);
|
UFS_UNIT_DESC_PARAM(large_unit_granularity, _LARGE_UNIT_SIZE_M1, 1);
|
||||||
UFS_UNIT_DESC_PARAM(wb_buf_alloc_units, _WB_BUF_ALLOC_UNITS, 4);
|
UFS_UNIT_DESC_PARAM(wb_buf_alloc_units, _WB_BUF_ALLOC_UNITS, 4);
|
||||||
@@ -1365,7 +1365,7 @@ static struct attribute *ufs_sysfs_unit_descriptor[] = {
|
|||||||
&dev_attr_logical_block_count.attr,
|
&dev_attr_logical_block_count.attr,
|
||||||
&dev_attr_erase_block_size.attr,
|
&dev_attr_erase_block_size.attr,
|
||||||
&dev_attr_provisioning_type.attr,
|
&dev_attr_provisioning_type.attr,
|
||||||
&dev_attr_physical_memory_resourse_count.attr,
|
&dev_attr_physical_memory_resource_count.attr,
|
||||||
&dev_attr_context_capabilities.attr,
|
&dev_attr_context_capabilities.attr,
|
||||||
&dev_attr_large_unit_granularity.attr,
|
&dev_attr_large_unit_granularity.attr,
|
||||||
&dev_attr_wb_buf_alloc_units.attr,
|
&dev_attr_wb_buf_alloc_units.attr,
|
||||||
|
@@ -528,7 +528,7 @@ static ssize_t pin_assignment_show(struct device *dev,
|
|||||||
|
|
||||||
assignments = get_current_pin_assignments(dp);
|
assignments = get_current_pin_assignments(dp);
|
||||||
|
|
||||||
for (i = 0; assignments; assignments >>= 1, i++) {
|
for (i = 0; assignments && i < DP_PIN_ASSIGN_MAX; assignments >>= 1, i++) {
|
||||||
if (assignments & 1) {
|
if (assignments & 1) {
|
||||||
if (i == cur)
|
if (i == cur)
|
||||||
len += sprintf(buf + len, "[%s] ",
|
len += sprintf(buf + len, "[%s] ",
|
||||||
|
@@ -4615,9 +4615,8 @@ static int btrfs_rmdir(struct inode *dir, struct dentry *dentry)
|
|||||||
{
|
{
|
||||||
struct inode *inode = d_inode(dentry);
|
struct inode *inode = d_inode(dentry);
|
||||||
struct btrfs_fs_info *fs_info = BTRFS_I(inode)->root->fs_info;
|
struct btrfs_fs_info *fs_info = BTRFS_I(inode)->root->fs_info;
|
||||||
int err = 0;
|
int ret = 0;
|
||||||
struct btrfs_trans_handle *trans;
|
struct btrfs_trans_handle *trans;
|
||||||
u64 last_unlink_trans;
|
|
||||||
struct fscrypt_name fname;
|
struct fscrypt_name fname;
|
||||||
|
|
||||||
if (inode->i_size > BTRFS_EMPTY_DIR_SIZE)
|
if (inode->i_size > BTRFS_EMPTY_DIR_SIZE)
|
||||||
@@ -4631,55 +4630,56 @@ static int btrfs_rmdir(struct inode *dir, struct dentry *dentry)
|
|||||||
return btrfs_delete_subvolume(BTRFS_I(dir), dentry);
|
return btrfs_delete_subvolume(BTRFS_I(dir), dentry);
|
||||||
}
|
}
|
||||||
|
|
||||||
err = fscrypt_setup_filename(dir, &dentry->d_name, 1, &fname);
|
ret = fscrypt_setup_filename(dir, &dentry->d_name, 1, &fname);
|
||||||
if (err)
|
if (ret)
|
||||||
return err;
|
return ret;
|
||||||
|
|
||||||
/* This needs to handle no-key deletions later on */
|
/* This needs to handle no-key deletions later on */
|
||||||
|
|
||||||
trans = __unlink_start_trans(BTRFS_I(dir));
|
trans = __unlink_start_trans(BTRFS_I(dir));
|
||||||
if (IS_ERR(trans)) {
|
if (IS_ERR(trans)) {
|
||||||
err = PTR_ERR(trans);
|
ret = PTR_ERR(trans);
|
||||||
goto out_notrans;
|
goto out_notrans;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Propagate the last_unlink_trans value of the deleted dir to its
|
||||||
|
* parent directory. This is to prevent an unrecoverable log tree in the
|
||||||
|
* case we do something like this:
|
||||||
|
* 1) create dir foo
|
||||||
|
* 2) create snapshot under dir foo
|
||||||
|
* 3) delete the snapshot
|
||||||
|
* 4) rmdir foo
|
||||||
|
* 5) mkdir foo
|
||||||
|
* 6) fsync foo or some file inside foo
|
||||||
|
*
|
||||||
|
* This is because we can't unlink other roots when replaying the dir
|
||||||
|
* deletes for directory foo.
|
||||||
|
*/
|
||||||
|
if (BTRFS_I(inode)->last_unlink_trans >= trans->transid)
|
||||||
|
btrfs_record_snapshot_destroy(trans, BTRFS_I(dir));
|
||||||
|
|
||||||
if (unlikely(btrfs_ino(BTRFS_I(inode)) == BTRFS_EMPTY_SUBVOL_DIR_OBJECTID)) {
|
if (unlikely(btrfs_ino(BTRFS_I(inode)) == BTRFS_EMPTY_SUBVOL_DIR_OBJECTID)) {
|
||||||
err = btrfs_unlink_subvol(trans, BTRFS_I(dir), dentry);
|
ret = btrfs_unlink_subvol(trans, BTRFS_I(dir), dentry);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
err = btrfs_orphan_add(trans, BTRFS_I(inode));
|
ret = btrfs_orphan_add(trans, BTRFS_I(inode));
|
||||||
if (err)
|
if (ret)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
last_unlink_trans = BTRFS_I(inode)->last_unlink_trans;
|
|
||||||
|
|
||||||
/* now the directory is empty */
|
/* now the directory is empty */
|
||||||
err = btrfs_unlink_inode(trans, BTRFS_I(dir), BTRFS_I(d_inode(dentry)),
|
ret = btrfs_unlink_inode(trans, BTRFS_I(dir), BTRFS_I(d_inode(dentry)),
|
||||||
&fname.disk_name);
|
&fname.disk_name);
|
||||||
if (!err) {
|
if (!ret)
|
||||||
btrfs_i_size_write(BTRFS_I(inode), 0);
|
btrfs_i_size_write(BTRFS_I(inode), 0);
|
||||||
/*
|
|
||||||
* Propagate the last_unlink_trans value of the deleted dir to
|
|
||||||
* its parent directory. This is to prevent an unrecoverable
|
|
||||||
* log tree in the case we do something like this:
|
|
||||||
* 1) create dir foo
|
|
||||||
* 2) create snapshot under dir foo
|
|
||||||
* 3) delete the snapshot
|
|
||||||
* 4) rmdir foo
|
|
||||||
* 5) mkdir foo
|
|
||||||
* 6) fsync foo or some file inside foo
|
|
||||||
*/
|
|
||||||
if (last_unlink_trans >= trans->transid)
|
|
||||||
BTRFS_I(dir)->last_unlink_trans = last_unlink_trans;
|
|
||||||
}
|
|
||||||
out:
|
out:
|
||||||
btrfs_end_transaction(trans);
|
btrfs_end_transaction(trans);
|
||||||
out_notrans:
|
out_notrans:
|
||||||
btrfs_btree_balance_dirty(fs_info);
|
btrfs_btree_balance_dirty(fs_info);
|
||||||
fscrypt_free_filename(&fname);
|
fscrypt_free_filename(&fname);
|
||||||
|
|
||||||
return err;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -1087,7 +1087,9 @@ again:
|
|||||||
search_key.type = BTRFS_INODE_REF_KEY;
|
search_key.type = BTRFS_INODE_REF_KEY;
|
||||||
search_key.offset = parent_objectid;
|
search_key.offset = parent_objectid;
|
||||||
ret = btrfs_search_slot(NULL, root, &search_key, path, 0, 0);
|
ret = btrfs_search_slot(NULL, root, &search_key, path, 0, 0);
|
||||||
if (ret == 0) {
|
if (ret < 0) {
|
||||||
|
return ret;
|
||||||
|
} else if (ret == 0) {
|
||||||
struct btrfs_inode_ref *victim_ref;
|
struct btrfs_inode_ref *victim_ref;
|
||||||
unsigned long ptr;
|
unsigned long ptr;
|
||||||
unsigned long ptr_end;
|
unsigned long ptr_end;
|
||||||
@@ -1160,13 +1162,13 @@ again:
|
|||||||
struct fscrypt_str victim_name;
|
struct fscrypt_str victim_name;
|
||||||
|
|
||||||
extref = (struct btrfs_inode_extref *)(base + cur_offset);
|
extref = (struct btrfs_inode_extref *)(base + cur_offset);
|
||||||
|
victim_name.len = btrfs_inode_extref_name_len(leaf, extref);
|
||||||
|
|
||||||
if (btrfs_inode_extref_parent(leaf, extref) != parent_objectid)
|
if (btrfs_inode_extref_parent(leaf, extref) != parent_objectid)
|
||||||
goto next;
|
goto next;
|
||||||
|
|
||||||
ret = read_alloc_one_name(leaf, &extref->name,
|
ret = read_alloc_one_name(leaf, &extref->name,
|
||||||
btrfs_inode_extref_name_len(leaf, extref),
|
victim_name.len, &victim_name);
|
||||||
&victim_name);
|
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
@@ -2442,15 +2442,26 @@ EXPORT_SYMBOL_GPL(nfs_net_id);
|
|||||||
static int nfs_net_init(struct net *net)
|
static int nfs_net_init(struct net *net)
|
||||||
{
|
{
|
||||||
struct nfs_net *nn = net_generic(net, nfs_net_id);
|
struct nfs_net *nn = net_generic(net, nfs_net_id);
|
||||||
|
int err;
|
||||||
|
|
||||||
nfs_clients_init(net);
|
nfs_clients_init(net);
|
||||||
|
|
||||||
if (!rpc_proc_register(net, &nn->rpcstats)) {
|
if (!rpc_proc_register(net, &nn->rpcstats)) {
|
||||||
nfs_clients_exit(net);
|
err = -ENOMEM;
|
||||||
return -ENOMEM;
|
goto err_proc_rpc;
|
||||||
}
|
}
|
||||||
|
|
||||||
return nfs_fs_proc_net_init(net);
|
err = nfs_fs_proc_net_init(net);
|
||||||
|
if (err)
|
||||||
|
goto err_proc_nfs;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
err_proc_nfs:
|
||||||
|
rpc_proc_unregister(net, "nfs");
|
||||||
|
err_proc_rpc:
|
||||||
|
nfs_clients_exit(net);
|
||||||
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void nfs_net_exit(struct net *net)
|
static void nfs_net_exit(struct net *net)
|
||||||
|
@@ -1930,8 +1930,10 @@ static void nfs_layoutget_begin(struct pnfs_layout_hdr *lo)
|
|||||||
static void nfs_layoutget_end(struct pnfs_layout_hdr *lo)
|
static void nfs_layoutget_end(struct pnfs_layout_hdr *lo)
|
||||||
{
|
{
|
||||||
if (atomic_dec_and_test(&lo->plh_outstanding) &&
|
if (atomic_dec_and_test(&lo->plh_outstanding) &&
|
||||||
test_and_clear_bit(NFS_LAYOUT_DRAIN, &lo->plh_flags))
|
test_and_clear_bit(NFS_LAYOUT_DRAIN, &lo->plh_flags)) {
|
||||||
|
smp_mb__after_atomic();
|
||||||
wake_up_bit(&lo->plh_flags, NFS_LAYOUT_DRAIN);
|
wake_up_bit(&lo->plh_flags, NFS_LAYOUT_DRAIN);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool pnfs_is_first_layoutget(struct pnfs_layout_hdr *lo)
|
static bool pnfs_is_first_layoutget(struct pnfs_layout_hdr *lo)
|
||||||
|
@@ -56,6 +56,7 @@ enum {
|
|||||||
DP_PIN_ASSIGN_D,
|
DP_PIN_ASSIGN_D,
|
||||||
DP_PIN_ASSIGN_E,
|
DP_PIN_ASSIGN_E,
|
||||||
DP_PIN_ASSIGN_F, /* Not supported after v1.0b */
|
DP_PIN_ASSIGN_F, /* Not supported after v1.0b */
|
||||||
|
DP_PIN_ASSIGN_MAX,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* DisplayPort alt mode specific commands */
|
/* DisplayPort alt mode specific commands */
|
||||||
|
@@ -2010,13 +2010,10 @@ static int hci_clear_adv_sets_sync(struct hci_dev *hdev, struct sock *sk)
|
|||||||
static int hci_clear_adv_sync(struct hci_dev *hdev, struct sock *sk, bool force)
|
static int hci_clear_adv_sync(struct hci_dev *hdev, struct sock *sk, bool force)
|
||||||
{
|
{
|
||||||
struct adv_info *adv, *n;
|
struct adv_info *adv, *n;
|
||||||
int err = 0;
|
|
||||||
|
|
||||||
if (ext_adv_capable(hdev))
|
if (ext_adv_capable(hdev))
|
||||||
/* Remove all existing sets */
|
/* Remove all existing sets */
|
||||||
err = hci_clear_adv_sets_sync(hdev, sk);
|
return hci_clear_adv_sets_sync(hdev, sk);
|
||||||
if (ext_adv_capable(hdev))
|
|
||||||
return err;
|
|
||||||
|
|
||||||
/* This is safe as long as there is no command send while the lock is
|
/* This is safe as long as there is no command send while the lock is
|
||||||
* held.
|
* held.
|
||||||
@@ -2044,13 +2041,11 @@ static int hci_clear_adv_sync(struct hci_dev *hdev, struct sock *sk, bool force)
|
|||||||
static int hci_remove_adv_sync(struct hci_dev *hdev, u8 instance,
|
static int hci_remove_adv_sync(struct hci_dev *hdev, u8 instance,
|
||||||
struct sock *sk)
|
struct sock *sk)
|
||||||
{
|
{
|
||||||
int err = 0;
|
int err;
|
||||||
|
|
||||||
/* If we use extended advertising, instance has to be removed first. */
|
/* If we use extended advertising, instance has to be removed first. */
|
||||||
if (ext_adv_capable(hdev))
|
if (ext_adv_capable(hdev))
|
||||||
err = hci_remove_ext_adv_instance_sync(hdev, instance, sk);
|
return hci_remove_ext_adv_instance_sync(hdev, instance, sk);
|
||||||
if (ext_adv_capable(hdev))
|
|
||||||
return err;
|
|
||||||
|
|
||||||
/* This is safe as long as there is no command send while the lock is
|
/* This is safe as long as there is no command send while the lock is
|
||||||
* held.
|
* held.
|
||||||
@@ -2149,16 +2144,13 @@ int hci_read_tx_power_sync(struct hci_dev *hdev, __le16 handle, u8 type)
|
|||||||
int hci_disable_advertising_sync(struct hci_dev *hdev)
|
int hci_disable_advertising_sync(struct hci_dev *hdev)
|
||||||
{
|
{
|
||||||
u8 enable = 0x00;
|
u8 enable = 0x00;
|
||||||
int err = 0;
|
|
||||||
|
|
||||||
/* If controller is not advertising we are done. */
|
/* If controller is not advertising we are done. */
|
||||||
if (!hci_dev_test_flag(hdev, HCI_LE_ADV))
|
if (!hci_dev_test_flag(hdev, HCI_LE_ADV))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (ext_adv_capable(hdev))
|
if (ext_adv_capable(hdev))
|
||||||
err = hci_disable_ext_adv_instance_sync(hdev, 0x00);
|
return hci_disable_ext_adv_instance_sync(hdev, 0x00);
|
||||||
if (ext_adv_capable(hdev))
|
|
||||||
return err;
|
|
||||||
|
|
||||||
return __hci_cmd_sync_status(hdev, HCI_OP_LE_SET_ADV_ENABLE,
|
return __hci_cmd_sync_status(hdev, HCI_OP_LE_SET_ADV_ENABLE,
|
||||||
sizeof(enable), &enable, HCI_CMD_TIMEOUT);
|
sizeof(enable), &enable, HCI_CMD_TIMEOUT);
|
||||||
@@ -2526,6 +2518,10 @@ static int hci_pause_advertising_sync(struct hci_dev *hdev)
|
|||||||
int err;
|
int err;
|
||||||
int old_state;
|
int old_state;
|
||||||
|
|
||||||
|
/* If controller is not advertising we are done. */
|
||||||
|
if (!hci_dev_test_flag(hdev, HCI_LE_ADV))
|
||||||
|
return 0;
|
||||||
|
|
||||||
/* If already been paused there is nothing to do. */
|
/* If already been paused there is nothing to do. */
|
||||||
if (hdev->advertising_paused)
|
if (hdev->advertising_paused)
|
||||||
return 0;
|
return 0;
|
||||||
|
@@ -1074,7 +1074,8 @@ static int mesh_send_done_sync(struct hci_dev *hdev, void *data)
|
|||||||
struct mgmt_mesh_tx *mesh_tx;
|
struct mgmt_mesh_tx *mesh_tx;
|
||||||
|
|
||||||
hci_dev_clear_flag(hdev, HCI_MESH_SENDING);
|
hci_dev_clear_flag(hdev, HCI_MESH_SENDING);
|
||||||
hci_disable_advertising_sync(hdev);
|
if (list_empty(&hdev->adv_instances))
|
||||||
|
hci_disable_advertising_sync(hdev);
|
||||||
mesh_tx = mgmt_mesh_next(hdev, NULL);
|
mesh_tx = mgmt_mesh_next(hdev, NULL);
|
||||||
|
|
||||||
if (mesh_tx)
|
if (mesh_tx)
|
||||||
@@ -2147,6 +2148,9 @@ static int set_mesh_sync(struct hci_dev *hdev, void *data)
|
|||||||
else
|
else
|
||||||
hci_dev_clear_flag(hdev, HCI_MESH);
|
hci_dev_clear_flag(hdev, HCI_MESH);
|
||||||
|
|
||||||
|
hdev->le_scan_interval = __le16_to_cpu(cp->period);
|
||||||
|
hdev->le_scan_window = __le16_to_cpu(cp->window);
|
||||||
|
|
||||||
len -= sizeof(*cp);
|
len -= sizeof(*cp);
|
||||||
|
|
||||||
/* If filters don't fit, forward all adv pkts */
|
/* If filters don't fit, forward all adv pkts */
|
||||||
@@ -2161,6 +2165,7 @@ static int set_mesh(struct sock *sk, struct hci_dev *hdev, void *data, u16 len)
|
|||||||
{
|
{
|
||||||
struct mgmt_cp_set_mesh *cp = data;
|
struct mgmt_cp_set_mesh *cp = data;
|
||||||
struct mgmt_pending_cmd *cmd;
|
struct mgmt_pending_cmd *cmd;
|
||||||
|
__u16 period, window;
|
||||||
int err = 0;
|
int err = 0;
|
||||||
|
|
||||||
bt_dev_dbg(hdev, "sock %p", sk);
|
bt_dev_dbg(hdev, "sock %p", sk);
|
||||||
@@ -2174,6 +2179,23 @@ static int set_mesh(struct sock *sk, struct hci_dev *hdev, void *data, u16 len)
|
|||||||
return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_MESH_RECEIVER,
|
return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_MESH_RECEIVER,
|
||||||
MGMT_STATUS_INVALID_PARAMS);
|
MGMT_STATUS_INVALID_PARAMS);
|
||||||
|
|
||||||
|
/* Keep allowed ranges in sync with set_scan_params() */
|
||||||
|
period = __le16_to_cpu(cp->period);
|
||||||
|
|
||||||
|
if (period < 0x0004 || period > 0x4000)
|
||||||
|
return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_MESH_RECEIVER,
|
||||||
|
MGMT_STATUS_INVALID_PARAMS);
|
||||||
|
|
||||||
|
window = __le16_to_cpu(cp->window);
|
||||||
|
|
||||||
|
if (window < 0x0004 || window > 0x4000)
|
||||||
|
return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_MESH_RECEIVER,
|
||||||
|
MGMT_STATUS_INVALID_PARAMS);
|
||||||
|
|
||||||
|
if (window > period)
|
||||||
|
return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_MESH_RECEIVER,
|
||||||
|
MGMT_STATUS_INVALID_PARAMS);
|
||||||
|
|
||||||
hci_dev_lock(hdev);
|
hci_dev_lock(hdev);
|
||||||
|
|
||||||
cmd = mgmt_pending_add(sk, MGMT_OP_SET_MESH_RECEIVER, hdev, data, len);
|
cmd = mgmt_pending_add(sk, MGMT_OP_SET_MESH_RECEIVER, hdev, data, len);
|
||||||
@@ -6536,6 +6558,7 @@ static int set_scan_params(struct sock *sk, struct hci_dev *hdev,
|
|||||||
return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_SCAN_PARAMS,
|
return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_SCAN_PARAMS,
|
||||||
MGMT_STATUS_NOT_SUPPORTED);
|
MGMT_STATUS_NOT_SUPPORTED);
|
||||||
|
|
||||||
|
/* Keep allowed ranges in sync with set_mesh() */
|
||||||
interval = __le16_to_cpu(cp->interval);
|
interval = __le16_to_cpu(cp->interval);
|
||||||
|
|
||||||
if (interval < 0x0004 || interval > 0x4000)
|
if (interval < 0x0004 || interval > 0x4000)
|
||||||
|
@@ -119,6 +119,8 @@ vmci_transport_packet_init(struct vmci_transport_packet *pkt,
|
|||||||
u16 proto,
|
u16 proto,
|
||||||
struct vmci_handle handle)
|
struct vmci_handle handle)
|
||||||
{
|
{
|
||||||
|
memset(pkt, 0, sizeof(*pkt));
|
||||||
|
|
||||||
/* We register the stream control handler as an any cid handle so we
|
/* We register the stream control handler as an any cid handle so we
|
||||||
* must always send from a source address of VMADDR_CID_ANY
|
* must always send from a source address of VMADDR_CID_ANY
|
||||||
*/
|
*/
|
||||||
@@ -131,8 +133,6 @@ vmci_transport_packet_init(struct vmci_transport_packet *pkt,
|
|||||||
pkt->type = type;
|
pkt->type = type;
|
||||||
pkt->src_port = src->svm_port;
|
pkt->src_port = src->svm_port;
|
||||||
pkt->dst_port = dst->svm_port;
|
pkt->dst_port = dst->svm_port;
|
||||||
memset(&pkt->proto, 0, sizeof(pkt->proto));
|
|
||||||
memset(&pkt->_reserved2, 0, sizeof(pkt->_reserved2));
|
|
||||||
|
|
||||||
switch (pkt->type) {
|
switch (pkt->type) {
|
||||||
case VMCI_TRANSPORT_PACKET_TYPE_INVALID:
|
case VMCI_TRANSPORT_PACKET_TYPE_INVALID:
|
||||||
|
Reference in New Issue
Block a user