Skip to content

Commit c2eca00

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) Don't save TIPC header values before the header has been validated, from Jon Paul Maloy. 2) Fix memory leak in RDS, from Zhu Yanjun. 3) We miss to initialize the UID in the flow key in some paths, from Julian Anastasov. 4) Fix latent TOS masking bug in the routing cache removal from years ago, also from Julian. 5) We forget to set the sockaddr port in sctp_copy_local_addr_list(), fix from Xin Long. 6) Missing module ref count drop in packet scheduler actions, from Roman Mashak. 7) Fix RCU annotations in rht_bucket_nested, from Herbert Xu. 8) Fix use after free which happens because L2TP's ipv4 support returns non-zero values from it's backlog_rcv function which ipv4 interprets as protocol values. Fix from Paul Hüber. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (35 commits) qed: Don't use attention PTT for configuring BW qed: Fix race with multiple VFs l2tp: avoid use-after-free caused by l2tp_ip_backlog_recv xfrm: provide correct dst in xfrm_neigh_lookup rhashtable: Fix RCU dereference annotation in rht_bucket_nested rhashtable: Fix use before NULL check in bucket_table_free net sched actions: do not overwrite status of action creation. rxrpc: Kernel calls get stuck in recvmsg net sched actions: decrement module reference count after table flush. lib: Allow compile-testing of parman ipv6: check sk sk_type and protocol early in ip_mroute_set/getsockopt sctp: set sin_port for addr param when checking duplicate address net/mlx4_en: fix overflow in mlx4_en_init_timestamp() netfilter: nft_set_bitmap: incorrect bitmap size net: s2io: fix typo argumnet argument net: vxge: fix typo argumnet argument netfilter: nf_ct_expect: Change __nf_ct_expect_check() return value. ipv4: mask tos for input route ipv4: add missing initialization for flowi4_uid lib: fix spelling mistake: "actualy" -> "actually" ...
2 parents 86292b3 + 2f44f75 commit c2eca00

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+209
-224
lines changed

drivers/net/ethernet/apm/xgene/xgene_enet_main.c

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -293,36 +293,29 @@ static int xgene_enet_tx_completion(struct xgene_enet_desc_ring *cp_ring,
293293
static int xgene_enet_setup_mss(struct net_device *ndev, u32 mss)
294294
{
295295
struct xgene_enet_pdata *pdata = netdev_priv(ndev);
296-
bool mss_index_found = false;
297-
int mss_index;
296+
int mss_index = -EBUSY;
298297
int i;
299298

300299
spin_lock(&pdata->mss_lock);
301300

302301
/* Reuse the slot if MSS matches */
303-
for (i = 0; !mss_index_found && i < NUM_MSS_REG; i++) {
302+
for (i = 0; mss_index < 0 && i < NUM_MSS_REG; i++) {
304303
if (pdata->mss[i] == mss) {
305304
pdata->mss_refcnt[i]++;
306305
mss_index = i;
307-
mss_index_found = true;
308306
}
309307
}
310308

311309
/* Overwrite the slot with ref_count = 0 */
312-
for (i = 0; !mss_index_found && i < NUM_MSS_REG; i++) {
310+
for (i = 0; mss_index < 0 && i < NUM_MSS_REG; i++) {
313311
if (!pdata->mss_refcnt[i]) {
314312
pdata->mss_refcnt[i]++;
315313
pdata->mac_ops->set_mss(pdata, mss, i);
316314
pdata->mss[i] = mss;
317315
mss_index = i;
318-
mss_index_found = true;
319316
}
320317
}
321318

322-
/* No slots with ref_count = 0 available, return busy */
323-
if (!mss_index_found)
324-
mss_index = -EBUSY;
325-
326319
spin_unlock(&pdata->mss_lock);
327320

328321
return mss_index;

drivers/net/ethernet/mellanox/mlx4/en_clock.c

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,17 @@ void mlx4_en_remove_timestamp(struct mlx4_en_dev *mdev)
8989
}
9090
}
9191

92+
#define MLX4_EN_WRAP_AROUND_SEC 10UL
93+
/* By scheduling the overflow check every 5 seconds, we have a reasonably
94+
* good chance we wont miss a wrap around.
95+
* TOTO: Use a timer instead of a work queue to increase the guarantee.
96+
*/
97+
#define MLX4_EN_OVERFLOW_PERIOD (MLX4_EN_WRAP_AROUND_SEC * HZ / 2)
98+
9299
void mlx4_en_ptp_overflow_check(struct mlx4_en_dev *mdev)
93100
{
94101
bool timeout = time_is_before_jiffies(mdev->last_overflow_check +
95-
mdev->overflow_period);
102+
MLX4_EN_OVERFLOW_PERIOD);
96103
unsigned long flags;
97104

98105
if (timeout) {
@@ -237,7 +244,6 @@ static const struct ptp_clock_info mlx4_en_ptp_clock_info = {
237244
.enable = mlx4_en_phc_enable,
238245
};
239246

240-
#define MLX4_EN_WRAP_AROUND_SEC 10ULL
241247

242248
/* This function calculates the max shift that enables the user range
243249
* of MLX4_EN_WRAP_AROUND_SEC values in the cycles register.
@@ -258,7 +264,6 @@ void mlx4_en_init_timestamp(struct mlx4_en_dev *mdev)
258264
{
259265
struct mlx4_dev *dev = mdev->dev;
260266
unsigned long flags;
261-
u64 ns, zero = 0;
262267

263268
/* mlx4_en_init_timestamp is called for each netdev.
264269
* mdev->ptp_clock is common for all ports, skip initialization if
@@ -282,13 +287,6 @@ void mlx4_en_init_timestamp(struct mlx4_en_dev *mdev)
282287
ktime_to_ns(ktime_get_real()));
283288
write_sequnlock_irqrestore(&mdev->clock_lock, flags);
284289

285-
/* Calculate period in seconds to call the overflow watchdog - to make
286-
* sure counter is checked at least once every wrap around.
287-
*/
288-
ns = cyclecounter_cyc2ns(&mdev->cycles, mdev->cycles.mask, zero, &zero);
289-
do_div(ns, NSEC_PER_SEC / 2 / HZ);
290-
mdev->overflow_period = ns;
291-
292290
/* Configure the PHC */
293291
mdev->ptp_clock_info = mlx4_en_ptp_clock_info;
294292
snprintf(mdev->ptp_clock_info.name, 16, "mlx4 ptp");

drivers/net/ethernet/mellanox/mlx4/mlx4_en.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,6 @@ struct mlx4_en_dev {
430430
seqlock_t clock_lock;
431431
struct timecounter clock;
432432
unsigned long last_overflow_check;
433-
unsigned long overflow_period;
434433
struct ptp_clock *ptp_clock;
435434
struct ptp_clock_info ptp_clock_info;
436435
struct notifier_block nb;

drivers/net/ethernet/neterion/s2io.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5397,7 +5397,7 @@ static void s2io_ethtool_gdrvinfo(struct net_device *dev,
53975397
* s2io_nic structure.
53985398
* @regs : pointer to the structure with parameters given by ethtool for
53995399
* dumping the registers.
5400-
* @reg_space: The input argumnet into which all the registers are dumped.
5400+
* @reg_space: The input argument into which all the registers are dumped.
54015401
* Description:
54025402
* Dumps the entire register space of xFrame NIC into the user given
54035403
* buffer area.

drivers/net/ethernet/neterion/vxge/vxge-ethtool.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ static void vxge_ethtool_gdrvinfo(struct net_device *dev,
119119
* @dev: device pointer.
120120
* @regs: pointer to the structure with parameters given by ethtool for
121121
* dumping the registers.
122-
* @reg_space: The input argumnet into which all the registers are dumped.
122+
* @reg_space: The input argument into which all the registers are dumped.
123123
*
124124
* Dumps the vpath register space of Titan NIC into the user given
125125
* buffer area.

drivers/net/ethernet/qlogic/qed/qed.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,9 @@ static inline u8 qed_concrete_to_sw_fid(struct qed_dev *cdev,
688688
#define OOO_LB_TC 9
689689

690690
int qed_configure_vport_wfq(struct qed_dev *cdev, u16 vp_id, u32 rate);
691-
void qed_configure_vp_wfq_on_link_change(struct qed_dev *cdev, u32 min_pf_rate);
691+
void qed_configure_vp_wfq_on_link_change(struct qed_dev *cdev,
692+
struct qed_ptt *p_ptt,
693+
u32 min_pf_rate);
692694

693695
void qed_clean_wfq_db(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt);
694696
#define QED_LEADING_HWFN(dev) (&dev->hwfns[0])

drivers/net/ethernet/qlogic/qed/qed_dev.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3198,7 +3198,8 @@ int qed_configure_vport_wfq(struct qed_dev *cdev, u16 vp_id, u32 rate)
31983198
}
31993199

32003200
/* API to configure WFQ from mcp link change */
3201-
void qed_configure_vp_wfq_on_link_change(struct qed_dev *cdev, u32 min_pf_rate)
3201+
void qed_configure_vp_wfq_on_link_change(struct qed_dev *cdev,
3202+
struct qed_ptt *p_ptt, u32 min_pf_rate)
32023203
{
32033204
int i;
32043205

@@ -3212,8 +3213,7 @@ void qed_configure_vp_wfq_on_link_change(struct qed_dev *cdev, u32 min_pf_rate)
32123213
for_each_hwfn(cdev, i) {
32133214
struct qed_hwfn *p_hwfn = &cdev->hwfns[i];
32143215

3215-
__qed_configure_vp_wfq_on_link_change(p_hwfn,
3216-
p_hwfn->p_dpc_ptt,
3216+
__qed_configure_vp_wfq_on_link_change(p_hwfn, p_ptt,
32173217
min_pf_rate);
32183218
}
32193219
}

drivers/net/ethernet/qlogic/qed/qed_mcp.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,8 @@ static void qed_mcp_handle_link_change(struct qed_hwfn *p_hwfn,
679679

680680
/* Min bandwidth configuration */
681681
__qed_configure_pf_min_bandwidth(p_hwfn, p_ptt, p_link, min_bw);
682-
qed_configure_vp_wfq_on_link_change(p_hwfn->cdev, p_link->min_pf_rate);
682+
qed_configure_vp_wfq_on_link_change(p_hwfn->cdev, p_ptt,
683+
p_link->min_pf_rate);
683684

684685
p_link->an = !!(status & LINK_STATUS_AUTO_NEGOTIATE_ENABLED);
685686
p_link->an_complete = !!(status &

drivers/net/ethernet/qlogic/qed/qed_sriov.c

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3014,8 +3014,7 @@ qed_iov_execute_vf_flr_cleanup(struct qed_hwfn *p_hwfn,
30143014
ack_vfs[vfid / 32] |= BIT((vfid % 32));
30153015
p_hwfn->pf_iov_info->pending_flr[rel_vf_id / 64] &=
30163016
~(1ULL << (rel_vf_id % 64));
3017-
p_hwfn->pf_iov_info->pending_events[rel_vf_id / 64] &=
3018-
~(1ULL << (rel_vf_id % 64));
3017+
p_vf->vf_mbx.b_pending_msg = false;
30193018
}
30203019

30213020
return rc;
@@ -3128,11 +3127,20 @@ static void qed_iov_process_mbx_req(struct qed_hwfn *p_hwfn,
31283127
mbx = &p_vf->vf_mbx;
31293128

31303129
/* qed_iov_process_mbx_request */
3131-
DP_VERBOSE(p_hwfn, QED_MSG_IOV,
3132-
"VF[%02x]: Processing mailbox message\n", p_vf->abs_vf_id);
3130+
if (!mbx->b_pending_msg) {
3131+
DP_NOTICE(p_hwfn,
3132+
"VF[%02x]: Trying to process mailbox message when none is pending\n",
3133+
p_vf->abs_vf_id);
3134+
return;
3135+
}
3136+
mbx->b_pending_msg = false;
31333137

31343138
mbx->first_tlv = mbx->req_virt->first_tlv;
31353139

3140+
DP_VERBOSE(p_hwfn, QED_MSG_IOV,
3141+
"VF[%02x]: Processing mailbox message [type %04x]\n",
3142+
p_vf->abs_vf_id, mbx->first_tlv.tl.type);
3143+
31363144
/* check if tlv type is known */
31373145
if (qed_iov_tlv_supported(mbx->first_tlv.tl.type) &&
31383146
!p_vf->b_malicious) {
@@ -3219,20 +3227,19 @@ static void qed_iov_process_mbx_req(struct qed_hwfn *p_hwfn,
32193227
}
32203228
}
32213229

3222-
static void qed_iov_pf_add_pending_events(struct qed_hwfn *p_hwfn, u8 vfid)
3230+
void qed_iov_pf_get_pending_events(struct qed_hwfn *p_hwfn, u64 *events)
32233231
{
3224-
u64 add_bit = 1ULL << (vfid % 64);
3232+
int i;
32253233

3226-
p_hwfn->pf_iov_info->pending_events[vfid / 64] |= add_bit;
3227-
}
3234+
memset(events, 0, sizeof(u64) * QED_VF_ARRAY_LENGTH);
32283235

3229-
static void qed_iov_pf_get_and_clear_pending_events(struct qed_hwfn *p_hwfn,
3230-
u64 *events)
3231-
{
3232-
u64 *p_pending_events = p_hwfn->pf_iov_info->pending_events;
3236+
qed_for_each_vf(p_hwfn, i) {
3237+
struct qed_vf_info *p_vf;
32333238

3234-
memcpy(events, p_pending_events, sizeof(u64) * QED_VF_ARRAY_LENGTH);
3235-
memset(p_pending_events, 0, sizeof(u64) * QED_VF_ARRAY_LENGTH);
3239+
p_vf = &p_hwfn->pf_iov_info->vfs_array[i];
3240+
if (p_vf->vf_mbx.b_pending_msg)
3241+
events[i / 64] |= 1ULL << (i % 64);
3242+
}
32363243
}
32373244

32383245
static struct qed_vf_info *qed_sriov_get_vf_from_absid(struct qed_hwfn *p_hwfn,
@@ -3266,7 +3273,7 @@ static int qed_sriov_vfpf_msg(struct qed_hwfn *p_hwfn,
32663273
p_vf->vf_mbx.pending_req = (((u64)vf_msg->hi) << 32) | vf_msg->lo;
32673274

32683275
/* Mark the event and schedule the workqueue */
3269-
qed_iov_pf_add_pending_events(p_hwfn, p_vf->relative_vf_id);
3276+
p_vf->vf_mbx.b_pending_msg = true;
32703277
qed_schedule_iov(p_hwfn, QED_IOV_WQ_MSG_FLAG);
32713278

32723279
return 0;
@@ -4030,7 +4037,7 @@ static void qed_handle_vf_msg(struct qed_hwfn *hwfn)
40304037
return;
40314038
}
40324039

4033-
qed_iov_pf_get_and_clear_pending_events(hwfn, events);
4040+
qed_iov_pf_get_pending_events(hwfn, events);
40344041

40354042
DP_VERBOSE(hwfn, QED_MSG_IOV,
40364043
"Event mask of VF events: 0x%llx 0x%llx 0x%llx\n",

drivers/net/ethernet/qlogic/qed/qed_sriov.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,9 @@ struct qed_iov_vf_mbx {
140140
/* Address in VF where a pending message is located */
141141
dma_addr_t pending_req;
142142

143+
/* Message from VF awaits handling */
144+
bool b_pending_msg;
145+
143146
u8 *offset;
144147

145148
/* saved VF request header */
@@ -232,7 +235,6 @@ struct qed_vf_info {
232235
*/
233236
struct qed_pf_iov {
234237
struct qed_vf_info vfs_array[MAX_NUM_VFS];
235-
u64 pending_events[QED_VF_ARRAY_LENGTH];
236238
u64 pending_flr[QED_VF_ARRAY_LENGTH];
237239

238240
/* Allocate message address continuosuly and split to each VF */

drivers/net/ethernet/stmicro/stmmac/common.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ struct stmmac_dma_ops {
416416
/* Configure the AXI Bus Mode Register */
417417
void (*axi)(void __iomem *ioaddr, struct stmmac_axi *axi);
418418
/* Dump DMA registers */
419-
void (*dump_regs) (void __iomem *ioaddr);
419+
void (*dump_regs)(void __iomem *ioaddr, u32 *reg_space);
420420
/* Set tx/rx threshold in the csr6 register
421421
* An invalid value enables the store-and-forward mode */
422422
void (*dma_mode)(void __iomem *ioaddr, int txmode, int rxmode,
@@ -456,7 +456,7 @@ struct stmmac_ops {
456456
/* Enable RX Queues */
457457
void (*rx_queue_enable)(struct mac_device_info *hw, u32 queue);
458458
/* Dump MAC registers */
459-
void (*dump_regs)(struct mac_device_info *hw);
459+
void (*dump_regs)(struct mac_device_info *hw, u32 *reg_space);
460460
/* Handle extra events on specific interrupts hw dependent */
461461
int (*host_irq_status)(struct mac_device_info *hw,
462462
struct stmmac_extra_stats *x);

drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,17 +92,13 @@ static int dwmac1000_rx_ipc_enable(struct mac_device_info *hw)
9292
return !!(value & GMAC_CONTROL_IPC);
9393
}
9494

95-
static void dwmac1000_dump_regs(struct mac_device_info *hw)
95+
static void dwmac1000_dump_regs(struct mac_device_info *hw, u32 *reg_space)
9696
{
9797
void __iomem *ioaddr = hw->pcsr;
9898
int i;
99-
pr_info("\tDWMAC1000 regs (base addr = 0x%p)\n", ioaddr);
10099

101-
for (i = 0; i < 55; i++) {
102-
int offset = i * 4;
103-
pr_info("\tReg No. %d (offset 0x%x): 0x%08x\n", i,
104-
offset, readl(ioaddr + offset));
105-
}
100+
for (i = 0; i < 55; i++)
101+
reg_space[i] = readl(ioaddr + i * 4);
106102
}
107103

108104
static void dwmac1000_set_umac_addr(struct mac_device_info *hw,

drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -201,18 +201,14 @@ static void dwmac1000_dma_operation_mode(void __iomem *ioaddr, int txmode,
201201
writel(csr6, ioaddr + DMA_CONTROL);
202202
}
203203

204-
static void dwmac1000_dump_dma_regs(void __iomem *ioaddr)
204+
static void dwmac1000_dump_dma_regs(void __iomem *ioaddr, u32 *reg_space)
205205
{
206206
int i;
207-
pr_info(" DMA registers\n");
208-
for (i = 0; i < 22; i++) {
209-
if ((i < 9) || (i > 17)) {
210-
int offset = i * 4;
211-
pr_err("\t Reg No. %d (offset 0x%x): 0x%08x\n", i,
212-
(DMA_BUS_MODE + offset),
213-
readl(ioaddr + DMA_BUS_MODE + offset));
214-
}
215-
}
207+
208+
for (i = 0; i < 22; i++)
209+
if ((i < 9) || (i > 17))
210+
reg_space[DMA_BUS_MODE / 4 + i] =
211+
readl(ioaddr + DMA_BUS_MODE + i * 4);
216212
}
217213

218214
static void dwmac1000_get_hw_feature(void __iomem *ioaddr,

drivers/net/ethernet/stmicro/stmmac/dwmac100_core.c

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -40,28 +40,18 @@ static void dwmac100_core_init(struct mac_device_info *hw, int mtu)
4040
#endif
4141
}
4242

43-
static void dwmac100_dump_mac_regs(struct mac_device_info *hw)
43+
static void dwmac100_dump_mac_regs(struct mac_device_info *hw, u32 *reg_space)
4444
{
4545
void __iomem *ioaddr = hw->pcsr;
46-
pr_info("\t----------------------------------------------\n"
47-
"\t DWMAC 100 CSR (base addr = 0x%p)\n"
48-
"\t----------------------------------------------\n", ioaddr);
49-
pr_info("\tcontrol reg (offset 0x%x): 0x%08x\n", MAC_CONTROL,
50-
readl(ioaddr + MAC_CONTROL));
51-
pr_info("\taddr HI (offset 0x%x): 0x%08x\n ", MAC_ADDR_HIGH,
52-
readl(ioaddr + MAC_ADDR_HIGH));
53-
pr_info("\taddr LO (offset 0x%x): 0x%08x\n", MAC_ADDR_LOW,
54-
readl(ioaddr + MAC_ADDR_LOW));
55-
pr_info("\tmulticast hash HI (offset 0x%x): 0x%08x\n",
56-
MAC_HASH_HIGH, readl(ioaddr + MAC_HASH_HIGH));
57-
pr_info("\tmulticast hash LO (offset 0x%x): 0x%08x\n",
58-
MAC_HASH_LOW, readl(ioaddr + MAC_HASH_LOW));
59-
pr_info("\tflow control (offset 0x%x): 0x%08x\n",
60-
MAC_FLOW_CTRL, readl(ioaddr + MAC_FLOW_CTRL));
61-
pr_info("\tVLAN1 tag (offset 0x%x): 0x%08x\n", MAC_VLAN1,
62-
readl(ioaddr + MAC_VLAN1));
63-
pr_info("\tVLAN2 tag (offset 0x%x): 0x%08x\n", MAC_VLAN2,
64-
readl(ioaddr + MAC_VLAN2));
46+
47+
reg_space[MAC_CONTROL / 4] = readl(ioaddr + MAC_CONTROL);
48+
reg_space[MAC_ADDR_HIGH / 4] = readl(ioaddr + MAC_ADDR_HIGH);
49+
reg_space[MAC_ADDR_LOW / 4] = readl(ioaddr + MAC_ADDR_LOW);
50+
reg_space[MAC_HASH_HIGH / 4] = readl(ioaddr + MAC_HASH_HIGH);
51+
reg_space[MAC_HASH_LOW / 4] = readl(ioaddr + MAC_HASH_LOW);
52+
reg_space[MAC_FLOW_CTRL / 4] = readl(ioaddr + MAC_FLOW_CTRL);
53+
reg_space[MAC_VLAN1 / 4] = readl(ioaddr + MAC_VLAN1);
54+
reg_space[MAC_VLAN2 / 4] = readl(ioaddr + MAC_VLAN2);
6555
}
6656

6757
static int dwmac100_rx_ipc_enable(struct mac_device_info *hw)

drivers/net/ethernet/stmicro/stmmac/dwmac100_dma.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,19 +66,18 @@ static void dwmac100_dma_operation_mode(void __iomem *ioaddr, int txmode,
6666
writel(csr6, ioaddr + DMA_CONTROL);
6767
}
6868

69-
static void dwmac100_dump_dma_regs(void __iomem *ioaddr)
69+
static void dwmac100_dump_dma_regs(void __iomem *ioaddr, u32 *reg_space)
7070
{
7171
int i;
7272

73-
pr_debug("DWMAC 100 DMA CSR\n");
7473
for (i = 0; i < 9; i++)
75-
pr_debug("\t CSR%d (offset 0x%x): 0x%08x\n", i,
76-
(DMA_BUS_MODE + i * 4),
77-
readl(ioaddr + DMA_BUS_MODE + i * 4));
74+
reg_space[DMA_BUS_MODE / 4 + i] =
75+
readl(ioaddr + DMA_BUS_MODE + i * 4);
7876

79-
pr_debug("\tCSR20 (0x%x): 0x%08x, CSR21 (0x%x): 0x%08x\n",
80-
DMA_CUR_TX_BUF_ADDR, readl(ioaddr + DMA_CUR_TX_BUF_ADDR),
81-
DMA_CUR_RX_BUF_ADDR, readl(ioaddr + DMA_CUR_RX_BUF_ADDR));
77+
reg_space[DMA_CUR_TX_BUF_ADDR / 4] =
78+
readl(ioaddr + DMA_CUR_TX_BUF_ADDR);
79+
reg_space[DMA_CUR_RX_BUF_ADDR / 4] =
80+
readl(ioaddr + DMA_CUR_RX_BUF_ADDR);
8281
}
8382

8483
/* DMA controller has two counters to track the number of the missed frames. */

0 commit comments

Comments
 (0)