All of lore.kernel.org
 help / color / mirror / Atom feed
* [bug report] Platform: OLPC: Add XO-1.75 EC driver
@ 2021-10-04 13:53 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2021-10-04 13:53 UTC (permalink / raw)
  To: lkundrak; +Cc: platform-driver-x86

Hello Lubomir Rintel,

The patch 0c3d931b3ab9: "Platform: OLPC: Add XO-1.75 EC driver" from
May 13, 2019, leads to the following Smatch static checker warning:

	drivers/platform/olpc/olpc-xo175-ec.c:363 olpc_xo175_ec_complete()
	warn: sleeping in atomic context

drivers/platform/olpc/olpc-xo175-ec.c
    350         case CHAN_SWITCH:
    351                 spin_lock_irqsave(&priv->cmd_state_lock, flags);
                        ^^^^^^^^^^^^^^^^^
Takes a spinlock

    352 
    353                 if (!priv->cmd_running) {
    354                         /* Just go with the flow */
    355                         dev_err(dev, "spurious SWITCH packet\n");
    356                         memset(&priv->cmd, 0, sizeof(priv->cmd));
    357                         priv->cmd.command = CMD_ECHO;
    358                 }
    359 
    360                 priv->cmd_state = CMD_STATE_CMD_IN_TX_FIFO;
    361 
    362                 /* Throw command into TxFIFO */
--> 363                 gpiod_set_value_cansleep(priv->gpio_cmd, 0);
                                        ^^^^^^^^
Can't sleep under spinlock.

    364                 olpc_xo175_ec_send_command(priv, &priv->cmd, sizeof(priv->cmd));
    365 
    366                 spin_unlock_irqrestore(&priv->cmd_state_lock, flags);
    367                 return;
    368 
    369         case CHAN_CMD_RESP:
    370                 spin_lock_irqsave(&priv->cmd_state_lock, flags);
    371 
    372                 if (!priv->cmd_running) {
    373                         dev_err(dev, "spurious response packet\n");

regards,
dan carpenter

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-10-04 13:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-04 13:53 [bug report] Platform: OLPC: Add XO-1.75 EC driver Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.