mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
To: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: [GIT PULL for-4.9 08/48] qed: Don't use attention PTT for configuring BW
Date: Wed, 11 Oct 2017 00:45:21 +0000	[thread overview]
Message-ID: <20171011004512.7949-9-alexander.levin@verizon.com> (raw)
In-Reply-To: <20171011004512.7949-1-alexander.levin@verizon.com>

From: "Mintz, Yuval" <Yuval.Mintz@cavium.com>

[ Upstream commit 6f437d431930ff86e4a971d29321951faadb97c7 ]

Commit 653d2ffd6405 ("qed*: Fix link indication race") introduced another
race - one of the inner functions called from the link-change flow is
explicitly using the slowpath context dedicated PTT instead of gaining
that PTT from the caller. Since this flow can now be called from
a different context as well, we're in risk of the PTT breaking.

Fixes: 653d2ffd6405 ("qed*: Fix link indication race")
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/net/ethernet/qlogic/qed/qed.h     | 4 +++-
 drivers/net/ethernet/qlogic/qed/qed_dev.c | 6 +++---
 drivers/net/ethernet/qlogic/qed/qed_mcp.c | 3 ++-
 3 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qed/qed.h b/drivers/net/ethernet/qlogic/qed/qed.h
index 653bb5735f0c..433f8be57847 100644
--- a/drivers/net/ethernet/qlogic/qed/qed.h
+++ b/drivers/net/ethernet/qlogic/qed/qed.h
@@ -642,7 +642,9 @@ static inline u8 qed_concrete_to_sw_fid(struct qed_dev *cdev,
 #define OOO_LB_TC 9
 
 int qed_configure_vport_wfq(struct qed_dev *cdev, u16 vp_id, u32 rate);
-void qed_configure_vp_wfq_on_link_change(struct qed_dev *cdev, u32 min_pf_rate);
+void qed_configure_vp_wfq_on_link_change(struct qed_dev *cdev,
+					 struct qed_ptt *p_ptt,
+					 u32 min_pf_rate);
 
 void qed_clean_wfq_db(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt);
 #define QED_LEADING_HWFN(dev)   (&dev->hwfns[0])
diff --git a/drivers/net/ethernet/qlogic/qed/qed_dev.c b/drivers/net/ethernet/qlogic/qed/qed_dev.c
index edae5fc5fccd..41367c490a7f 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_dev.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_dev.c
@@ -2732,7 +2732,8 @@ int qed_configure_vport_wfq(struct qed_dev *cdev, u16 vp_id, u32 rate)
 }
 
 /* API to configure WFQ from mcp link change */
-void qed_configure_vp_wfq_on_link_change(struct qed_dev *cdev, u32 min_pf_rate)
+void qed_configure_vp_wfq_on_link_change(struct qed_dev *cdev,
+					 struct qed_ptt *p_ptt, u32 min_pf_rate)
 {
 	int i;
 
@@ -2746,8 +2747,7 @@ void qed_configure_vp_wfq_on_link_change(struct qed_dev *cdev, u32 min_pf_rate)
 	for_each_hwfn(cdev, i) {
 		struct qed_hwfn *p_hwfn = &cdev->hwfns[i];
 
-		__qed_configure_vp_wfq_on_link_change(p_hwfn,
-						      p_hwfn->p_dpc_ptt,
+		__qed_configure_vp_wfq_on_link_change(p_hwfn, p_ptt,
 						      min_pf_rate);
 	}
 }
diff --git a/drivers/net/ethernet/qlogic/qed/qed_mcp.c b/drivers/net/ethernet/qlogic/qed/qed_mcp.c
index bdc9ba92f6d4..8b7d2f963ee1 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_mcp.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_mcp.c
@@ -628,7 +628,8 @@ static void qed_mcp_handle_link_change(struct qed_hwfn *p_hwfn,
 
 	/* Min bandwidth configuration */
 	__qed_configure_pf_min_bandwidth(p_hwfn, p_ptt, p_link, min_bw);
-	qed_configure_vp_wfq_on_link_change(p_hwfn->cdev, p_link->min_pf_rate);
+	qed_configure_vp_wfq_on_link_change(p_hwfn->cdev, p_ptt,
+					    p_link->min_pf_rate);
 
 	p_link->an = !!(status & LINK_STATUS_AUTO_NEGOTIATE_ENABLED);
 	p_link->an_complete = !!(status &
-- 
2.11.0

  parent reply	other threads:[~2017-10-11  1:06 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-11  0:45 [GIT PULL for-4.9 00/48] Commits for v4.9 LTS Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.9 01/48] xen-netback: Use GFP_ATOMIC to allocate hash Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.9 02/48] locking/lockdep: Add nest_lock integrity test Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.9 03/48] watchdog: kempld: fix gcc-4.3 build Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.9 04/48] irqchip/crossbar: Fix incorrect type of local variables Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.9 06/48] mac80211_hwsim: check HWSIM_ATTR_RADIO_NAME length Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.9 05/48] initramfs: finish fput() before accessing any binary from initramfs Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.9 07/48] ALSA: hda: Add Geminilake HDMI codec ID Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.9 10/48] net/mlx4_en: fix overflow in mlx4_en_init_timestamp() Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.9 09/48] mac80211: fix power saving clients handling in iwlwifi Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` Levin, Alexander (Sasha Levin) [this message]
2017-10-11  0:45 ` [GIT PULL for-4.9 11/48] staging: vchiq_2835_arm: Make cache-line-size a required DT property Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.9 12/48] netfilter: nf_ct_expect: Change __nf_ct_expect_check() return value Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.9 14/48] f2fs: do SSR for data when there is enough free space Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.9 15/48] sched/fair: Update rq clock before changing a task's CPU affinity Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.9 13/48] iio: adc: xilinx: Fix error handling Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.9 18/48] md/linear: shutup lockdep warnning Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.9 19/48] sparc64: Migrate hvcons irq to panicked cpu Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.9 17/48] f2fs: do not wait for writeback in write_begin Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.9 16/48] Btrfs: send, fix failure to rename top level inode due to name collision Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.9 22/48] mm/memory_hotplug: set magic number to page->freelist instead of page->lru.next Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.9 20/48] net/mlx4_core: Fix VF overwrite of module param which disables DMFS on new probed PFs Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.9 21/48] crypto: xts - Add ECB dependency Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.9 25/48] scsi: scsi_dh_emc: return success in clariion_std_inquiry() Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.9 26/48] ASoC: mediatek: add I2C dependency for CS42XX8 Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.9 23/48] ocfs2/dlmglue: prepare tracking logic to avoid recursive cluster lock Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.9 24/48] slub: do not merge cache if slub_debug contains a never-merge flag Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.9 30/48] qed: Reserve doorbell BAR space for present CPUs Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.9 29/48] qede: Prevent index problems in loopback test Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.9 28/48] net: mvpp2: release reference to txq_cpu[] entry after unmapping Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.9 27/48] drm/amdgpu: refuse to reserve io mem for split VRAM buffers Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.9 33/48] ceph: don't update_dentry_lease unless we actually got one Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.9 31/48] qed: Read queue state before releasing buffer Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.9 34/48] ceph: fix bogus endianness change in ceph_ioctl_set_layout Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.9 32/48] i2c: at91: ensure state is restored after suspending Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.9 36/48] uapi: fix linux/rds.h userspace compilation errors Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.9 38/48] IB/hfi1: Use static CTLE with Preset 6 for integrated HFIs Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.9 35/48] ceph: clean up unsafe d_parent accesses in build_dentry_path Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.9 37/48] uapi: fix linux/mroute6.h userspace compilation errors Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.9 41/48] hrtimer: Catch invalid clockids again Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.9 43/48] powerpc/perf: Add restrictions to PMC5 in power9 DD1 Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.9 40/48] target/iscsi: Fix unsolicited data seq_end_offset calculation Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.9 42/48] nfsd/callback: Cleanup callback cred on shutdown Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.9 39/48] IB/hfi1: Allocate context data on memory node Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.9 47/48] EDAC, mce_amd: Print IPID and Syndrome on a separate line Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.9 46/48] btmrvl: avoid double-disable_irq() race Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.9 44/48] drm/nouveau/gr/gf100-: fix ccache error logging Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.9 45/48] regulator: core: Resolve supplies before disabling unused regulators Levin, Alexander (Sasha Levin)
2017-10-11  0:45 ` [GIT PULL for-4.9 48/48] cpufreq: CPPC: add ACPI_PROCESSOR dependency Levin, Alexander (Sasha Levin)
2017-10-19 13:13 ` [GIT PULL for-4.9 00/48] Commits for v4.9 LTS gregkh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171011004512.7949-9-alexander.levin@verizon.com \
    --to=alexander.levin@verizon.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®