i2c: mxs: suppress probe-deferral error message
Subsystems (9)
Sasha Levin
maintainerPATCH 1/6 i2c: mxs: suppress probe-deferral error message
From: Stefan Wahren <[email protected]>
[ Upstream commit 78a4471fa1a76a8bef4919105de67660a89a1e9b ]
During boot of I2SE Duckbill the kernel log contains a confusing error:
Failed to request dma
This is caused by i2c-mxs tries to request a not yet available DMA channel (-EPROBE_DEFER). So suppress this message by using dev_err_probe().
--- drivers/i2c/busses/i2c-mxs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/i2c/busses/i2c-mxs.c +2 -2
@@ -842,8 +842,8 @@ static int mxs_i2c_probe(struct platform_device *pdev)/* Setup the DMA */ i2c->dmach =dma_request_chan (dev,"rx-tx" );if (IS_ERR (i2c->dmach)) { -dev_err (dev,"Failed to request dma\n" ); -return PTR_ERR (i2c->dmach); +return dev_err_probe (dev,PTR_ERR (i2c->dmach), +"Failed to request dma\n" ); }platform_set_drvdata (pdev, i2c);
Signature · 7 lines
2.39.0 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sasha Levin
maintainerPATCH 2/6 scsi: target: core: Fix warning on RT kernels
From: Maurizio Lombardi <[email protected]>
[ Upstream commit 84ed64b1a7a7fcd507598dee7708c1f225123711 ]
Calling spin_lock_irqsave() does not disable the interrupts on realtime kernels, remove the warning and replace assert_spin_locked() with lockdep_assert_held().
--- drivers/target/target_core_tmr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/target/target_core_tmr.c +2 -2
@@ -82,8 +82,8 @@ static bool __target_check_io_state(struct se_cmd *se_cmd, {struct se_session *sess = se_cmd->se_sess; -assert_spin_locked (&sess->sess_cmd_lock); -WARN_ON_ONCE (!irqs_disabled ()); +lockdep_assert_held (&sess->sess_cmd_lock); +/* * If command already reached CMD_T_COMPLETE state within * target_complete_cmd() or CMD_T_FABRIC_STOP due to shutdown,
Signature · 1 line
2.39.0
Sasha Levin
maintainerPATCH 3/6 scsi: iscsi_tcp: Fix UAF during login when accessing the shost ipaddress
In reply to Sasha LevinFrom: Mike Christie <[email protected]>
[ Upstream commit f484a794e4ee2a9ce61f52a78e810ac45f3fe3b3 ]
If during iscsi_sw_tcp_session_create() iscsi_tcp_r2tpool_alloc() fails, userspace could be accessing the host's ipaddress attr. If we then free the session via iscsi_session_teardown() while userspace is still accessing the session we will hit a use after free bug.
Set the tcp_sw_host->session after we have completed session creation and can no longer fail.
--- drivers/scsi/iscsi_tcp.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/scsi/iscsi_tcp.c +6 -3
@@ -802,7 +802,7 @@ static int iscsi_sw_tcp_host_get_param(struct Scsi_Host *shost, enum iscsi_host_param param, char *buf) { struct iscsi_sw_tcp_host *tcp_sw_host = iscsi_host_priv(shost); -struct iscsi_session *session = tcp_sw_host->session; +struct iscsi_session *session;struct iscsi_conn *conn;struct iscsi_tcp_conn *tcp_conn;struct iscsi_sw_tcp_conn *tcp_sw_conn;
@@ -812,6 +812,7 @@ static int iscsi_sw_tcp_host_get_param(struct Scsi_Host *shost,switch (param) {case ISCSI_HOST_PARAM_IPADDRESS : + session = tcp_sw_host->session;if (!session)return -ENOTCONN ;
@@ -906,12 +907,14 @@ iscsi_sw_tcp_session_create(struct iscsi_endpoint *ep, uint16_t cmds_max,if (!cls_session) goto remove_host; session = cls_session->dd_data; - tcp_sw_host =iscsi_host_priv (shost); - tcp_sw_host->session = session; shost->can_queue = session->scsi_cmds_max;if (iscsi_tcp_r2tpool_alloc (session)) goto remove_session; + +/* We are now fully setup so expose the session to sysfs. */ + tcp_sw_host =iscsi_host_priv (shost); + tcp_sw_host->session = session;return cls_session; remove_session:
Signature · 1 line
2.39.0
Sasha Levin
maintainerPATCH 4/6 i2c: rk3x: fix a bunch of kernel-doc warnings
In reply to Sasha LevinFrom: Randy Dunlap <[email protected]>
[ Upstream commit 0582d984793d30442da88fe458674502bad1ad29 ]
Fix multiple W=1 kernel-doc warnings in i2c-rk3x.c:
drivers/i2c/busses/i2c-rk3x.c:83: warning: missing initial short description on line:
* struct i2c_spec_values:drivers/i2c/busses/i2c-rk3x.c:139: warning: missing initial short description on line:
* struct rk3x_i2c_calced_timings:drivers/i2c/busses/i2c-rk3x.c:162: warning: missing initial short description on line:
* struct rk3x_i2c_soc_data:drivers/i2c/busses/i2c-rk3x.c:242: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
* Generate a START condition, which triggers a REG_INT_START interrupt.drivers/i2c/busses/i2c-rk3x.c:261: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
* Generate a STOP condition, which triggers a REG_INT_STOP interrupt.drivers/i2c/busses/i2c-rk3x.c:304: warning: expecting prototype for Setup a read according to i2c(). Prototype was for rk3x_i2c_prepare_read() instead drivers/i2c/busses/i2c-rk3x.c:335: warning: expecting prototype for Fill the transmit buffer with data from i2c(). Prototype was for rk3x_i2c_fill_transmit_buf() instead drivers/i2c/busses/i2c-rk3x.c:535: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
* Get timing values of I2C specificationdrivers/i2c/busses/i2c-rk3x.c:552: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
* Calculate divider values for desired SCL frequencydrivers/i2c/busses/i2c-rk3x.c:713: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
* Calculate timing values for desired SCL frequencydrivers/i2c/busses/i2c-rk3x.c:963: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
* Setup I2C registers for an I2C operation specified by msgs, num.
--- drivers/i2c/busses/i2c-rk3x.c | 44 +++++++++++++++++------------------ 1 file changed, 22 insertions(+), 22 deletions(-)
drivers/i2c/busses/i2c-rk3x.c +22 -22
@@ -80,7 +80,7 @@ enum {#define DEFAULT_SCL_RATE (100 * 1000)/* Hz */ /** -* struct i2c_spec_values: +* struct i2c_spec_values - I2C specification values for various modes * @min_hold_start_ns: min hold time (repeated) START condition * @min_low_ns: min LOW period of the SCL clock * @min_high_ns: min HIGH period of the SCL cloc
@@ -136,7 +136,7 @@ static const struct i2c_spec_values fast_mode_plus_spec = { };/** -* struct rk3x_i2c_calced_timings: +* struct rk3x_i2c_calced_timings - calculated V1 timings * @div_low: Divider output for low * @div_high: Divider output for high * @tuning: Used to adjust setup/hold data time,
@@ -159,7 +159,7 @@ enum rk3x_i2c_state { };/** -* struct rk3x_i2c_soc_data: +* struct rk3x_i2c_soc_data - SOC-specific data * @grf_offset: offset inside the grf regmap for setting the i2c type * @calc_timings: Callback function for i2c timing information calculated */
@@ -239,7 +239,8 @@ static inline void rk3x_i2c_clean_ipd(struct rk3x_i2c *i2c) }/** -* Generate a START condition, which triggers a REG_INT_START interrupt. +* rk3x_i2c_start - Generate a START condition, which triggers a REG_INT_START interrupt. +* @i2c: target controller data */ static void rk3x_i2c_start (struct rk3x_i2c *i2c) {
@@ -258,8 +259,8 @@ static void rk3x_i2c_start(struct rk3x_i2c *i2c) }/** -* Generate a STOP condition, which triggers a REG_INT_STOP interrupt. -* +* rk3x_i2c_stop - Generate a STOP condition, which triggers a REG_INT_STOP interrupt. +* @i2c: target controller data * @error: Error code to return in rk3x_i2c_xfer */ static void rk3x_i2c_stop (struct rk3x_i2c *i2c,int error)
@@ -298,7 +299,8 @@ static void rk3x_i2c_stop(struct rk3x_i2c *i2c, int error) }/** -* Setup a read according to i2c->msg +* rk3x_i2c_prepare_read - Setup a read according to i2c->msg +* @i2c: target controller data */ static void rk3x_i2c_prepare_read (struct rk3x_i2c *i2c) {
@@ -329,7 +331,8 @@ static void rk3x_i2c_prepare_read(struct rk3x_i2c *i2c) }/** -* Fill the transmit buffer with data from i2c->msg +* rk3x_i2c_fill_transmit_buf - Fill the transmit buffer with data from i2c->msg +* @i2c: target controller data */ static void rk3x_i2c_fill_transmit_buf (struct rk3x_i2c *i2c) {
@@ -532,11 +535,10 @@ static irqreturn_t rk3x_i2c_irq(int irqno, void *dev_id) }/** -* Get timing values of I2C specification -* +* rk3x_i2c_get_spec - Get timing values of I2C specification * @speed: Desired SCL frequency * -* Returns: Matched i2c spec values. +* Return: Matched i2c_spec_values. */ static const struct i2c_spec_values *rk3x_i2c_get_spec (unsigned int speed) {
@@ -549,13 +551,12 @@ static const struct i2c_spec_values *rk3x_i2c_get_spec(unsigned int speed) }/** -* Calculate divider values for desired SCL frequency -* +* rk3x_i2c_v0_calc_timings - Calculate divider values for desired SCL frequency * @clk_rate: I2C input clock rate * @t: Known I2C timing information * @t_calc: Caculated rk3x private timings that would be written into regs * -* Returns: 0 on success, -EINVAL if the goal SCL rate is too slow. In that case +* Return: %0 on success, -%EINVAL if the goal SCL rate is too slow. In that case * a best-effort divider value is returned in divs. If the target rate is * too high, we silently use the highest possible rate. */
@@ -710,13 +711,12 @@ static int rk3x_i2c_v0_calc_timings(unsigned long clk_rate, }/** -* Calculate timing values for desired SCL frequency -* +* rk3x_i2c_v1_calc_timings - Calculate timing values for desired SCL frequency * @clk_rate: I2C input clock rate * @t: Known I2C timing information * @t_calc: Caculated rk3x private timings that would be written into regs * -* Returns: 0 on success, -EINVAL if the goal SCL rate is too slow. In that case +* Return: %0 on success, -%EINVAL if the goal SCL rate is too slow. In that case * a best-effort divider value is returned in divs. If the target rate is * too high, we silently use the highest possible rate. * The following formulas are v1's method to calculate timings.
@@ -960,14 +960,14 @@ static int rk3x_i2c_clk_notifier_cb(struct notifier_block *nb, unsigned long }/** -* Setup I2C registers for an I2C operation specified by msgs, num. -* -* Must be called with i2c->lock held. -* +* rk3x_i2c_setup - Setup I2C registers for an I2C operation specified by msgs, num. +* @i2c: target controller data * @msgs: I2C msgs to process * @num: Number of msgs * -* returns: Number of I2C msgs processed or negative in case of error +* Must be called with i2c->lock held. +* +* Return: Number of I2C msgs processed or negative in case of error */ static int rk3x_i2c_setup (struct rk3x_i2c *i2c,struct i2c_msg *msgs,int num) {
Signature · 7 lines
2.39.0 _______________________________________________ Linux-rockchip mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-rockchip
Sasha Levin
maintainerPATCH 5/6 platform/x86: dell-wmi: Add a keymap for KEY_MUTE in type 0x0010 table
In reply to Sasha LevinFrom: Koba Ko <[email protected]>
[ Upstream commit 83bcf3e52e9cfc727df33f1055ef0618c91719d0 ]
Some platforms send the speaker-mute key from EC. dell-wmi can't recognize it.
Add a new keymap for KEY_MUTE in type 0x0010 table.
--- drivers/platform/x86/dell-wmi.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/platform/x86/dell-wmi.c +3 -0
@@ -259,6 +259,9 @@ static const struct key_entry dell_wmi_keymap_type_0010[] = { { KE_KEY, 0x57, { KEY_BRIGHTNESSDOWN } }, { KE_KEY, 0x58, { KEY_BRIGHTNESSUP } }, +/*Speaker Mute*/ + { KE_KEY, 0x109, { KEY_MUTE} }, +/* Mic mute */ { KE_KEY, 0x150, { KEY_MICMUTE } },
Signature · 1 line
2.39.0
Sasha Levin
maintainerPATCH 6/6 net/x25: Fix to not accept on connected socket
In reply to Sasha LevinFrom: Hyunwoo Kim <[email protected]>
[ Upstream commit f2b0b5210f67c56a3bcdf92ff665fb285d6e0067 ]
When listen() and accept() are called on an x25 socket that connect() succeeds, accept() succeeds immediately. This is because x25_connect() queues the skb to sk->sk_receive_queue, and x25_accept() dequeues it.
This creates a child socket with the sk of the parent x25 socket, which can cause confusion.
Fix x25_listen() to return -EINVAL if the socket has already been successfully connect()ed to avoid this issue.
--- net/x25/af_x25.c | 6 ++++++ 1 file changed, 6 insertions(+)
net/x25/af_x25.c +6 -0
@@ -492,6 +492,12 @@ static int x25_listen(struct socket *sock, int backlog)int rc = -EOPNOTSUPP ;lock_sock (sk); +if (sock->state !=SS_UNCONNECTED ) { + rc = -EINVAL ; +release_sock (sk); +return rc; + } +if (sk->sk_state !=TCP_LISTEN ) {memset (&x25_sk (sk)->dest_addr,0 ,X25_ADDR_LEN ); sk->sk_max_ack_backlog = backlog;
Signature · 1 line
2.39.0