Commit 44089339 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Merge tag 'for-3.19-rc' of...

Merge tag 'for-3.19-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux-phy into usb-linus

Kishon writes:

misc fixes in PHY drivers
parents b3ee8bdc 0bc09f9c
...@@ -1127,6 +1127,24 @@ static void schedule_external_copy(struct thin_c *tc, dm_block_t virt_block, ...@@ -1127,6 +1127,24 @@ static void schedule_external_copy(struct thin_c *tc, dm_block_t virt_block,
schedule_zero(tc, virt_block, data_dest, cell, bio); schedule_zero(tc, virt_block, data_dest, cell, bio);
} }
static void set_pool_mode(struct pool *pool, enum pool_mode new_mode);
static void check_for_space(struct pool *pool)
{
int r;
dm_block_t nr_free;
if (get_pool_mode(pool) != PM_OUT_OF_DATA_SPACE)
return;
r = dm_pool_get_free_block_count(pool->pmd, &nr_free);
if (r)
return;
if (nr_free)
set_pool_mode(pool, PM_WRITE);
}
/* /*
* A non-zero return indicates read_only or fail_io mode. * A non-zero return indicates read_only or fail_io mode.
* Many callers don't care about the return value. * Many callers don't care about the return value.
...@@ -1141,6 +1159,8 @@ static int commit(struct pool *pool) ...@@ -1141,6 +1159,8 @@ static int commit(struct pool *pool)
r = dm_pool_commit_metadata(pool->pmd); r = dm_pool_commit_metadata(pool->pmd);
if (r) if (r)
metadata_operation_failed(pool, "dm_pool_commit_metadata", r); metadata_operation_failed(pool, "dm_pool_commit_metadata", r);
else
check_for_space(pool);
return r; return r;
} }
...@@ -1159,8 +1179,6 @@ static void check_low_water_mark(struct pool *pool, dm_block_t free_blocks) ...@@ -1159,8 +1179,6 @@ static void check_low_water_mark(struct pool *pool, dm_block_t free_blocks)
} }
} }
static void set_pool_mode(struct pool *pool, enum pool_mode new_mode);
static int alloc_data_block(struct thin_c *tc, dm_block_t *result) static int alloc_data_block(struct thin_c *tc, dm_block_t *result)
{ {
int r; int r;
...@@ -2155,7 +2173,7 @@ static void set_pool_mode(struct pool *pool, enum pool_mode new_mode) ...@@ -2155,7 +2173,7 @@ static void set_pool_mode(struct pool *pool, enum pool_mode new_mode)
pool->process_cell = process_cell_read_only; pool->process_cell = process_cell_read_only;
pool->process_discard_cell = process_discard_cell; pool->process_discard_cell = process_discard_cell;
pool->process_prepared_mapping = process_prepared_mapping; pool->process_prepared_mapping = process_prepared_mapping;
pool->process_prepared_discard = process_prepared_discard_passdown; pool->process_prepared_discard = process_prepared_discard;
if (!pool->pf.error_if_no_space && no_space_timeout) if (!pool->pf.error_if_no_space && no_space_timeout)
queue_delayed_work(pool->wq, &pool->no_space_timeout, no_space_timeout); queue_delayed_work(pool->wq, &pool->no_space_timeout, no_space_timeout);
...@@ -3814,6 +3832,8 @@ static int thin_ctr(struct dm_target *ti, unsigned argc, char **argv) ...@@ -3814,6 +3832,8 @@ static int thin_ctr(struct dm_target *ti, unsigned argc, char **argv)
r = -EINVAL; r = -EINVAL;
goto bad; goto bad;
} }
atomic_set(&tc->refcount, 1);
init_completion(&tc->can_destroy);
list_add_tail_rcu(&tc->list, &tc->pool->active_thins); list_add_tail_rcu(&tc->list, &tc->pool->active_thins);
spin_unlock_irqrestore(&tc->pool->lock, flags); spin_unlock_irqrestore(&tc->pool->lock, flags);
/* /*
...@@ -3826,9 +3846,6 @@ static int thin_ctr(struct dm_target *ti, unsigned argc, char **argv) ...@@ -3826,9 +3846,6 @@ static int thin_ctr(struct dm_target *ti, unsigned argc, char **argv)
dm_put(pool_md); dm_put(pool_md);
atomic_set(&tc->refcount, 1);
init_completion(&tc->can_destroy);
return 0; return 0;
bad: bad:
......
...@@ -899,7 +899,7 @@ static void disable_write_same(struct mapped_device *md) ...@@ -899,7 +899,7 @@ static void disable_write_same(struct mapped_device *md)
static void clone_endio(struct bio *bio, int error) static void clone_endio(struct bio *bio, int error)
{ {
int r = 0; int r = error;
struct dm_target_io *tio = container_of(bio, struct dm_target_io, clone); struct dm_target_io *tio = container_of(bio, struct dm_target_io, clone);
struct dm_io *io = tio->io; struct dm_io *io = tio->io;
struct mapped_device *md = tio->io->md; struct mapped_device *md = tio->io->md;
......
...@@ -1050,7 +1050,8 @@ static int miphy28lp_init(struct phy *phy) ...@@ -1050,7 +1050,8 @@ static int miphy28lp_init(struct phy *phy)
ret = miphy28lp_init_usb3(miphy_phy); ret = miphy28lp_init_usb3(miphy_phy);
break; break;
default: default:
return -EINVAL; ret = -EINVAL;
break;
} }
mutex_unlock(&miphy_dev->miphy_mutex); mutex_unlock(&miphy_dev->miphy_mutex);
......
...@@ -29,10 +29,9 @@ ...@@ -29,10 +29,9 @@
/** /**
* omap_control_pcie_pcs - set the PCS delay count * omap_control_pcie_pcs - set the PCS delay count
* @dev: the control module device * @dev: the control module device
* @id: index of the pcie PHY (should be 1 or 2)
* @delay: 8 bit delay value * @delay: 8 bit delay value
*/ */
void omap_control_pcie_pcs(struct device *dev, u8 id, u8 delay) void omap_control_pcie_pcs(struct device *dev, u8 delay)
{ {
u32 val; u32 val;
struct omap_control_phy *control_phy; struct omap_control_phy *control_phy;
...@@ -55,8 +54,8 @@ void omap_control_pcie_pcs(struct device *dev, u8 id, u8 delay) ...@@ -55,8 +54,8 @@ void omap_control_pcie_pcs(struct device *dev, u8 id, u8 delay)
val = readl(control_phy->pcie_pcs); val = readl(control_phy->pcie_pcs);
val &= ~(OMAP_CTRL_PCIE_PCS_MASK << val &= ~(OMAP_CTRL_PCIE_PCS_MASK <<
(id * OMAP_CTRL_PCIE_PCS_DELAY_COUNT_SHIFT)); OMAP_CTRL_PCIE_PCS_DELAY_COUNT_SHIFT);
val |= delay << (id * OMAP_CTRL_PCIE_PCS_DELAY_COUNT_SHIFT); val |= (delay << OMAP_CTRL_PCIE_PCS_DELAY_COUNT_SHIFT);
writel(val, control_phy->pcie_pcs); writel(val, control_phy->pcie_pcs);
} }
EXPORT_SYMBOL_GPL(omap_control_pcie_pcs); EXPORT_SYMBOL_GPL(omap_control_pcie_pcs);
......
...@@ -244,7 +244,8 @@ static int sun4i_usb_phy_probe(struct platform_device *pdev) ...@@ -244,7 +244,8 @@ static int sun4i_usb_phy_probe(struct platform_device *pdev)
else else
data->num_phys = 3; data->num_phys = 3;
if (of_device_is_compatible(np, "allwinner,sun4i-a10-usb-phy")) if (of_device_is_compatible(np, "allwinner,sun4i-a10-usb-phy") ||
of_device_is_compatible(np, "allwinner,sun6i-a31-usb-phy"))
data->disc_thresh = 3; data->disc_thresh = 3;
else else
data->disc_thresh = 2; data->disc_thresh = 2;
......
...@@ -82,7 +82,6 @@ struct ti_pipe3 { ...@@ -82,7 +82,6 @@ struct ti_pipe3 {
struct clk *refclk; struct clk *refclk;
struct clk *div_clk; struct clk *div_clk;
struct pipe3_dpll_map *dpll_map; struct pipe3_dpll_map *dpll_map;
u8 id;
}; };
static struct pipe3_dpll_map dpll_map_usb[] = { static struct pipe3_dpll_map dpll_map_usb[] = {
...@@ -217,8 +216,13 @@ static int ti_pipe3_init(struct phy *x) ...@@ -217,8 +216,13 @@ static int ti_pipe3_init(struct phy *x)
u32 val; u32 val;
int ret = 0; int ret = 0;
/*
* Set pcie_pcs register to 0x96 for proper functioning of phy
* as recommended in AM572x TRM SPRUHZ6, section 18.5.2.2, table
* 18-1804.
*/
if (of_device_is_compatible(phy->dev->of_node, "ti,phy-pipe3-pcie")) { if (of_device_is_compatible(phy->dev->of_node, "ti,phy-pipe3-pcie")) {
omap_control_pcie_pcs(phy->control_dev, phy->id, 0xF1); omap_control_pcie_pcs(phy->control_dev, 0x96);
return 0; return 0;
} }
...@@ -347,8 +351,6 @@ static int ti_pipe3_probe(struct platform_device *pdev) ...@@ -347,8 +351,6 @@ static int ti_pipe3_probe(struct platform_device *pdev)
} }
if (of_device_is_compatible(node, "ti,phy-pipe3-pcie")) { if (of_device_is_compatible(node, "ti,phy-pipe3-pcie")) {
if (of_property_read_u8(node, "id", &phy->id) < 0)
phy->id = 1;
clk = devm_clk_get(phy->dev, "dpll_ref"); clk = devm_clk_get(phy->dev, "dpll_ref");
if (IS_ERR(clk)) { if (IS_ERR(clk)) {
......
...@@ -66,7 +66,7 @@ enum omap_control_usb_mode { ...@@ -66,7 +66,7 @@ enum omap_control_usb_mode {
#define OMAP_CTRL_PIPE3_PHY_TX_RX_POWEROFF 0x0 #define OMAP_CTRL_PIPE3_PHY_TX_RX_POWEROFF 0x0
#define OMAP_CTRL_PCIE_PCS_MASK 0xff #define OMAP_CTRL_PCIE_PCS_MASK 0xff
#define OMAP_CTRL_PCIE_PCS_DELAY_COUNT_SHIFT 0x8 #define OMAP_CTRL_PCIE_PCS_DELAY_COUNT_SHIFT 16
#define OMAP_CTRL_USB2_PHY_PD BIT(28) #define OMAP_CTRL_USB2_PHY_PD BIT(28)
...@@ -79,7 +79,7 @@ enum omap_control_usb_mode { ...@@ -79,7 +79,7 @@ enum omap_control_usb_mode {
void omap_control_phy_power(struct device *dev, int on); void omap_control_phy_power(struct device *dev, int on);
void omap_control_usb_set_mode(struct device *dev, void omap_control_usb_set_mode(struct device *dev,
enum omap_control_usb_mode mode); enum omap_control_usb_mode mode);
void omap_control_pcie_pcs(struct device *dev, u8 id, u8 delay); void omap_control_pcie_pcs(struct device *dev, u8 delay);
#else #else
static inline void omap_control_phy_power(struct device *dev, int on) static inline void omap_control_phy_power(struct device *dev, int on)
...@@ -91,7 +91,7 @@ static inline void omap_control_usb_set_mode(struct device *dev, ...@@ -91,7 +91,7 @@ static inline void omap_control_usb_set_mode(struct device *dev,
{ {
} }
static inline void omap_control_pcie_pcs(struct device *dev, u8 id, u8 delay) static inline void omap_control_pcie_pcs(struct device *dev, u8 delay)
{ {
} }
#endif #endif
......
...@@ -2378,12 +2378,12 @@ void unmap_mapping_range(struct address_space *mapping, ...@@ -2378,12 +2378,12 @@ void unmap_mapping_range(struct address_space *mapping,
details.last_index = ULONG_MAX; details.last_index = ULONG_MAX;
i_mmap_lock_read(mapping); i_mmap_lock_write(mapping);
if (unlikely(!RB_EMPTY_ROOT(&mapping->i_mmap))) if (unlikely(!RB_EMPTY_ROOT(&mapping->i_mmap)))
unmap_mapping_range_tree(&mapping->i_mmap, &details); unmap_mapping_range_tree(&mapping->i_mmap, &details);
if (unlikely(!list_empty(&mapping->i_mmap_nonlinear))) if (unlikely(!list_empty(&mapping->i_mmap_nonlinear)))
unmap_mapping_range_list(&mapping->i_mmap_nonlinear, &details); unmap_mapping_range_list(&mapping->i_mmap_nonlinear, &details);
i_mmap_unlock_read(mapping); i_mmap_unlock_write(mapping);
} }
EXPORT_SYMBOL(unmap_mapping_range); EXPORT_SYMBOL(unmap_mapping_range);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment