Skip to content

Commit

Permalink
net: ipa: eliminate legacy arguments
Browse files Browse the repository at this point in the history
We enable a channel doorbell engine only for IPA v3.5.1, and that is
now handled directly by gsi_channel_program().

When initially setting up a channel, we want that doorbell engine
enabled, and we can request that independent of the IPA version.

Doing that makes the "legacy" argument to gsi_channel_setup_one()
unnecessary.  And with that gone we can get rid of the "legacy"
argument to gsi_channel_setup(), and gsi_setup() as well.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Alex Elder authored and Jakub Kicinski committed Nov 5, 2020
1 parent ce54993 commit d387c76
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
13 changes: 6 additions & 7 deletions drivers/net/ipa/gsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1454,8 +1454,7 @@ static void gsi_evt_ring_teardown(struct gsi *gsi)
}

/* Setup function for a single channel */
static int gsi_channel_setup_one(struct gsi *gsi, u32 channel_id,
bool legacy)
static int gsi_channel_setup_one(struct gsi *gsi, u32 channel_id)
{
struct gsi_channel *channel = &gsi->channel[channel_id];
u32 evt_ring_id = channel->evt_ring_id;
Expand All @@ -1474,7 +1473,7 @@ static int gsi_channel_setup_one(struct gsi *gsi, u32 channel_id,
if (ret)
goto err_evt_ring_de_alloc;

gsi_channel_program(channel, legacy);
gsi_channel_program(channel, true);

if (channel->toward_ipa)
netif_tx_napi_add(&gsi->dummy_dev, &channel->napi,
Expand Down Expand Up @@ -1551,7 +1550,7 @@ static void gsi_modem_channel_halt(struct gsi *gsi, u32 channel_id)
}

/* Setup function for channels */
static int gsi_channel_setup(struct gsi *gsi, bool legacy)
static int gsi_channel_setup(struct gsi *gsi)
{
u32 channel_id = 0;
u32 mask;
Expand All @@ -1563,7 +1562,7 @@ static int gsi_channel_setup(struct gsi *gsi, bool legacy)
mutex_lock(&gsi->mutex);

do {
ret = gsi_channel_setup_one(gsi, channel_id, legacy);
ret = gsi_channel_setup_one(gsi, channel_id);
if (ret)
goto err_unwind;
} while (++channel_id < gsi->channel_count);
Expand Down Expand Up @@ -1649,7 +1648,7 @@ static void gsi_channel_teardown(struct gsi *gsi)
}

/* Setup function for GSI. GSI firmware must be loaded and initialized */
int gsi_setup(struct gsi *gsi, bool legacy)
int gsi_setup(struct gsi *gsi)
{
struct device *dev = gsi->dev;
u32 val;
Expand Down Expand Up @@ -1693,7 +1692,7 @@ int gsi_setup(struct gsi *gsi, bool legacy)
/* Writing 1 indicates IRQ interrupts; 0 would be MSI */
iowrite32(1, gsi->virt + GSI_CNTXT_INTSET_OFFSET);

return gsi_channel_setup(gsi, legacy);
return gsi_channel_setup(gsi);
}

/* Inverse of gsi_setup() */
Expand Down
3 changes: 1 addition & 2 deletions drivers/net/ipa/gsi.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,14 +166,13 @@ struct gsi {
/**
* gsi_setup() - Set up the GSI subsystem
* @gsi: Address of GSI structure embedded in an IPA structure
* @legacy: Set up for legacy hardware
*
* Return: 0 if successful, or a negative error code
*
* Performs initialization that must wait until the GSI hardware is
* ready (including firmware loaded).
*/
int gsi_setup(struct gsi *gsi, bool legacy);
int gsi_setup(struct gsi *gsi);

/**
* gsi_teardown() - Tear down GSI subsystem
Expand Down
3 changes: 1 addition & 2 deletions drivers/net/ipa/ipa_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,7 @@ int ipa_setup(struct ipa *ipa)
struct device *dev = &ipa->pdev->dev;
int ret;

/* Setup for IPA v3.5.1 has some slight differences */
ret = gsi_setup(&ipa->gsi, ipa->version == IPA_VERSION_3_5_1);
ret = gsi_setup(&ipa->gsi);
if (ret)
return ret;

Expand Down

0 comments on commit d387c76

Please sign in to comment.